swagger-api/swagger-js

Feature to configure accept-header for config file requests

2WeltenChris opened this issue · 1 comments

Content & configuration

Link to Swagger/OpenAPI definition

Is your feature request related to a problem?

We are the developers of openapi-red and have a user whoms yaml-file is served with the now deprecated text/yaml media type. As a result the request to fetch the configuration file fails with a 403 Not Acceptable error. For more information please take a look at the issue here.

Describe the solution you'd like

We would like to have an option to control which accept-header gets set in the request. This would allow to either override the header with the expected media-type or to even set it to */* to ignore the media type completely.

Swagger({
  url: 'https://...',
  acceptHeaderValueForDocuments: '*/*'
}).then((client) => {
  // ...
})

Closing this issue as it can easily be fixed using a reuquest interceptor.