Coder Social home page Coder Social logo

Comments (8)

JFCote avatar JFCote commented on June 2, 2024 1

@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.

JFCote avatar JFCote commented on June 2, 2024

@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.

gervaisb avatar gervaisb commented on June 2, 2024

I made a quick test, it seems that the parser does not set the example property for the "byte" format.

from openapi-style-validator.

JFCote avatar JFCote commented on June 2, 2024

@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.

gervaisb avatar gervaisb commented on June 2, 2024

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.

tymonx avatar tymonx commented on June 2, 2024

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.

acabarbaye avatar acabarbaye commented on June 2, 2024

same seems to be true with format: binary

from openapi-style-validator.

gervaisb avatar gervaisb commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.