pb33f / libopenapi

libopenapi is a fully featured, high performance OpenAPI 3.1, 3.0 and Swagger parser, library, validator and toolkit for golang applications.
https://pb33f.io/libopenapi/
Other
362 stars 46 forks source link

Bug: securitySchemes oauth2 empty scopes is stripped #289

Closed khart-twilio closed 3 weeks ago

khart-twilio commented 3 weeks ago

input:

components:
  securitySchemes:
    someName:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://oauth.somewhere.com/v1/token
          scopes: {}

invalid output (scopes key is removed but is required as per https://swagger.io/docs/specification/authentication/oauth2/):

components:
  securitySchemes:
    someName:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://oauth.somewhere.com/v1/token

can this be fixed, and in the meantime what is the best way to work around the issue?

Thanks for the library, I love the website style :)

daveshanley commented 3 weeks ago

Fixed in v0.16.6 Thank you for your contribution!

khart-twilio commented 2 weeks ago

Thanks, I was digging into the tests but it takes a while to get familiar. I appreciate you taking it up!