asynction icon indicating copy to clipboard operation
asynction copied to clipboard

Docs viewer unhappy with Oauth2 Security scheme

Open alex-zywicki opened this issue 3 years ago • 5 comments

When using the newly added security schemes, with the following yaml snippet.

  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: /oauth/basic
          scopes:
            secure_ping:access: "Access SecurePing"
      x-tokenInfoFunc: token_info

I get these error messages from the /docs/ endpoint

/components/securitySchemes/oauth2 should have required property '$ref'.
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should have required property 'in'
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2 should have required property 'scheme'
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT be valid
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2 should have required property 'scheme'
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should have required property 'name'
/components/securitySchemes/oauth2 should have required property 'in'
/components/securitySchemes/oauth2 should match exactly one schema in oneOf
/components/securitySchemes/oauth2/flows/implicit/authorizationUrl should match format "uri"
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should have required property 'openIdConnectUrl'
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should NOT have additional properties
/components/securitySchemes/oauth2/type should be equal to one of the allowed values
/components/securitySchemes/oauth2 should match exactly one schema in oneOf
/components/securitySchemes/oauth2 should match exactly one schema in oneOf
/components/securitySchemes/oauth2 should match exactly one schema in oneOf

alex-zywicki avatar Dec 10 '21 17:12 alex-zywicki

@alex-zywicki This looks like an unfortunately error handling on behalf of the @asyncapi/parser js library. The actual issue with the securityScheme snippet above is that the securitySchemes/oauth2/flows/implicit/authorizationUrl value is not of a valid URI format. After correcting this, I was able to visualise the security schemes of the server (through asynction):

image

dedoussis avatar Dec 15 '21 20:12 dedoussis

@alex-zywicki Have raised an issue in the parser-js repo of AsyncAPI. If you're happy with it, I'll close the current issue.

dedoussis avatar Dec 15 '21 20:12 dedoussis

For posterity The issue

alex-zywicki avatar Dec 15 '21 20:12 alex-zywicki

@dedoussis Can we leave this open until there is some sort of resolution on their end? If they do fix it Asynction would need to bump its version of the docs viewer right?

alex-zywicki avatar Dec 15 '21 20:12 alex-zywicki

Yes. Good point. Will leave it open.

dedoussis avatar Dec 15 '21 20:12 dedoussis