-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples not reads when format: byte
#1630
Comments
After digging into the parser, I see that the value is skipped in this part of the code:
io/swagger/v3/oas/models/media/ByteArraySchema.java:50 The value is not null but is a |
@gervaisb thanks for reporting this. It is a bit tricky and has been addressed in #1682, and will be available in next release. TLDRProbably in your case the best option is to set either system property or env variable Short backgroundSwagger Core "models" - also for historical reasons - provides a hierarchy of classes representing Json Schema constructs; depending on Given that there is not much added value in using specialized classes |
Thanks @frantuma for the explanation. I am just wondering why you can't try the conversion from the
|
we have added indeed such conversion in swagger-api/swagger-core#4147, therefore you can use it if it fits your needs (by using parser "as is" , with no The first possible issue with this approach is that the conversion / data binding is opinionated, as it uses Another issue is serialization of the parsed string, in this case the serialized value will be encoded in Base64, resulting in a different string from the one parsed. We might choose to try using Base64 in the An additional issue is serialization to example: !!binary |-
Y2FjY2E= We could further address the points above by e.g. providing more options and addressing the different cases, but on top of adding quite some complexity and being not trivial, the expected behaviour would be dependent on the specific spec. |
Thanks for your work. Any idea when it will be released? |
no fixed ETA but probably within first week of April |
Hello there,
From the openapi-style-validator project, we have an issue with properties of type
string
and formatbyte
where theexample
is not read: OpenAPITools/openapi-style-validator#132Schema:
Expected:
An OpenAPI with
example
set for thecontent
property.Actual:
example
isnull
.We do not know if this is expected behaviour or an issue on the parser, can someone tell us more on that "issue" ?
Thanks
The text was updated successfully, but these errors were encountered: