Comments (8)
@gervaisb and @tymonx. As soon as swagger-parser release a new version with this fix, I will update our dependency and create a new release.
Thanks for the workaround in the meantime! :)
from openapi-style-validator.
@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!
from openapi-style-validator.
I made a quick test, it seems that the parser does not set the example
property for the "byte" format.
- A test that use the parser fail: https://github.com/gervaisb/openapi-style-validator/blob/e5fe49551c8103856dacd632948dd4c91019b9ae/cli/src/test/java/org/openapitools/openapistylevalidator/cli/MainTest.java#L320
- Another that use a "hand made" OpenApi pass: https://github.com/gervaisb/openapi-style-validator/blob/e5fe49551c8103856dacd632948dd4c91019b9ae/lib/src/test/java/org/openapitools/openapistylevalidator/OpenApiSpecStyleValidatorTest.java#L262
from openapi-style-validator.
@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 byte
field examples here: https://swagger.io/docs/specification/adding-examples/
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.
from openapi-style-validator.
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)
from openapi-style-validator.
I have the same issue here. As temporary workaround I use format: base64
with additional pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$'
.
from openapi-style-validator.
same seems to be true with format: binary
from openapi-style-validator.
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)
We should be able to fix that issue as soon as they release that fix.
However, regarding the opinionated issues mentioned in the linked comment, should we not support the new swaggerParserBinaryAsString
property too?
from openapi-style-validator.
Related Issues (20)
- Remove Sonarcloud completely HOT 1
- Create a github action that release on Maven when we create a tag HOT 2
- Dependency issue with the gradle plugin HOT 3
- Validation for multiple Spec files in the same repository HOT 11
- The build is broken HOT 1
- is any tools with validate the openApi param by the Java annotation of io.swagger.v3.oas.annotations.media.Schema HOT 3
- Update README.md to talk about the Maven and Gradle plugin and how to use it.
- Add custom validation rules HOT 2
- Allow more granularity in paramater naming convention configuration HOT 6
- Remove .idea folder from the project and replace it with .editorconfig
- Use Graalvm for native binary support for CLI
- Required fields are not validated when creating a model inside an allOf HOT 1
- Pascal Case Support HOT 7
- Typo in specs/options.json HOT 2
- '_links' -> property should be in camelCase HOT 2
- 👍 Thanks for opening this issue!
- Schema name validation feature
- Schema name validation in Maven plugin release HOT 5
- Recursive property name validation feature HOT 1
- Enum value validation feature HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-style-validator.