-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
base64 type properties fail validation for lack of example #132
Comments
@shoffmeister Thanks for the bug report! I'm not sure when I'll be able to look at this, I'm very busy for the next 2 weeks but if you send me a PR, I will try to review it quickly and make sure we do a release. Otherwise, it might take a couple of weeks. Thanks! |
I made a quick test, it seems that the parser does not set the
|
@gervaisb So either it's a bug with swagger-parser that we use under the hood or swagger-parser follow specification and a byte field should not have example. I can't find any specific information about the If it's a bug: We need to create a bug in their project. https://github.com/swagger-api/swagger-parser If it's meant to be like that and follow spec, we need to create a special validation that when the field is "byte", we don't count it as an error when there are no examples. I don't have time right now to dig deeper but if you have some time, you could go and create an issue in their project since you already have examples. |
It seems to be a bug on the parser that tries to cast the example to the wrong type: swagger-api/swagger-parser#1630 (comment) |
I have the same issue here. As temporary workaround I use |
same seems to be true with format: binary |
Hello there, The parser has been patched, it will now automatically get the bytes of a string. However, there are some implications with this fix, see this comment in the issue: swagger-api/swagger-parser#1630 (comment) However, regarding the opinionated issues mentioned in the linked comment, should we not support the new |
Whenever an object has a property of base64 (i.e. type: string, format: byte) validation will fail the error message
although the field example is present. This is really tied to the property being of type base64; remove the "format: byte" and the specification document will pass validation.
To reproduce, download the attached Zip file y.zip which contains two files minimally reproducing:
pom.xml
broken-validation-base64-response.yaml
Run
mvn verify
//exp: passes validation
//act: ERROR in Model
The text was updated successfully, but these errors were encountered: