I have swagger-ui running in a Docker container. I am trying to fetch my openapi.json API definition file which is protected by an X-API-Key.
How can I tell swagger-ui to capture and use an X-API-Key header from the client before fetching the OpenAPI definition file?
My API documentation is not public and I’d like the user to authenticate with their X-API-Key before having access to the documentation.
The openapi.json file is already set up to require a valid X-API-Key header in order to access the file, so it won’t load in Swagger-UI without passing the key.