ecyrbe / zodios

typescript http client and server with zod validation
https://www.zodios.org/
MIT License
1.66k stars 45 forks source link

Transforming response of an API that has content-type: text/html #581

Closed alexandergallen closed 7 months ago

alexandergallen commented 8 months ago

I am currently dealing with an external API that only returns responses with Content-type: text/html. (eventhough they are json)

Would it be possible to add a feature that forces the Zod response validation of an text/html response? ... Or is there any easy way for me to implement this for this specific case?

hanayashiki commented 8 months ago

You can write an Axios plugin to patch the content-type into application/json before consumed by Zodios

stale[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.