openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
535 stars 67 forks source link

Cant use URL definition when the service has sloppy headers. #180

Open dogmatic69 opened 4 months ago

dogmatic69 commented 4 months ago

I'm trying to use a service from yaml def but the server responds with octet-stream so openapi-client-axios fails. Due to this I'll have to manually fetch it, parse and pass in the object. Perhaps could just check the url ends in y?ml or pass in a config yaml: true or similar to ignore any headers.

Content-Type: application/octet-stream

affected code from what I can tell.

https://github.com/openapistack/openapi-client-axios/blob/main/packages/openapi-client-axios/src/client.ts#L208C25-L208C68