rapi-doc/RapiDoc

OAuth URL ignores server sub-path

Closed this issue · 1 comments

Using the basic HTML, consider the following spec:

openapi: 3.1.0
servers:
  - url: 'http://example.com/api'
    description: Production

info:
  title: API Documentation
  description: Hello, World!
  version: v1.0

paths:
  /helloworld:
    get:
      description: Hi World
      responses:
        default:
          description: Unexpected error.
      security:
        - oAuth2ClientCredentials: []

components:
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      description: client_credentials grant
      flows:
        clientCredentials:
          tokenUrl: /subpath/token
          scopes: {}

Expected

When I attempt to authorise, it makes a POST to http://example.com/api/subpath/token.

Actual

It makes a request to http://example.com/subpath/token.
I suspect this is also true for other flows which use things like authorizationUrl etc.

Also, I tried the example and the authentication section is empty - I couldn't authenticate at all (probably a separate issue).

unable to recreate the issue at my end
https://codesandbox.io/p/sandbox/vanilla-js-template-forked-j643pq

this is how it renders . The tokenUrl is correctly compose

image

Feel free to open new issue if i overlooked something