Bug: Server url base path in OpenAPI definitions is ignored

I’ve built my first plugin and am currently testing it. In my openapi.yaml manifest, I have defined servers where my APIs live. Note how my server has the base path /api:

openapi: 3.1.0
  title: API Title
  description: API description
  version: 1.0.0
    - url: https://my.domain.com/api
    ... and so on

The plugin ignores the base path and calls the endpoint https://my.domain.com/search and gets a 404 Not found error response. The workaround for this is to prepend the base path to each path in paths, e.g. /api/search, in the definition. The workaround is not according to the spec. One can see in the Server Object example from the spec that base paths are permitted.

I don’t believe you can pass a specific URL like that, it needs to just be your domain, specific paths will not work, removing the “/api” should fix this issue. I’ll double check this but pretty sure we do this for security reasons.

1 Like

This post was flagged by the community and is temporarily hidden.