Closed jamwest closed 1 year ago
Thanks you for the proposal,
yes at the moment zodios open api description only handles application/json You can dive into the source code, it's not much complicated. I thinks it's always better to have feature constructed on real use cases.
Today, api definition has something called requestFormat. Maybe we could augment it with a responseFormat also.
it would be json by default and you could override it. This way, we could have openapi map the response type if it's not json.
example:
const api = makeApi([{
method: 'get',
path: '/protobuf-endpoint',
responseFormat: 'application/protobuf',
response: z.instanceof(Blob),
}]);
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.
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.
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.
Hi,
Thank you for making such a cool library!
I currently have a use case where I am returning files and protobuf as arrayBuffers in Zodios. Unfortunately the openapi generation is not taking responseType into account and is hardcoding the content-type as application/json. Could the content-type be based upon the responseType with the default going to application/json?
It may need the option to add content-type into Zodios api/error definitions but a good first step would be setting based on responseType.