rapi-doc/RapiDoc

Problem with OAuth 2.0 using refs for client credentials

Closed this issue · 3 comments

Hi, we use refs for get client credentials in OAuth 2.0 security scheme.
In RapiDoc 9.3.4 this works well. After updating to v9.3.7/v9.3.8 referenced file is not used and functionality doesn't work.

Could you pls advise me what could be the reason of this changes and how we could fix it for using new versions of RapiDoc.

after small research we found out that using different openapi version lead to different results.
If we use openapi v3.0.3 everything works well as before, but with v3.1.0 rapidoc doesn't get referenced file and as result doesn't use it. Here is file example:

openapi: 3.1.0
info:
  version: '1.0'
  title: External refs (json-pointers)
  
paths:
  /external-refs:
    get:
      summary: External Refs
      description: Using external refs in spec
      responses:
        '200':
          content:
            application/json:
              schema:
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          $ref: 'openapi-vars.yaml#/OAuthFlows/clientCredentials'
security:
  - OAuth2: []

in later versions of RapiDoc v9.3.4 we have updated our OpenAPI parsers to be more compliant with OpenAPI 3.1.0
This could be an issue.

Also do you know in OpenAPI 3.1.0, refs are not allowed in everyplace but only in certain location
please refer this issue comment if its related.

Please feel to close the issue if it solves your case or add ur findings

thank you for clarification, issue closed.