-
Notifications
You must be signed in to change notification settings - Fork 74
feat: add text/csv media type support #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add text/csv media type support #321
Conversation
|
@fabien0102 |
fabien0102
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost perfect! Thanks for the contribution! Just a little improvement on the types and we are good to go
| }); | ||
|
|
||
| it("should return MediaTypeObject for application/json", () => { | ||
| const mediaTypeObject = { schema: { type: "object" as const } }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const mediaTypeObject = { schema: { type: "object" as const } }; | |
| const mediaTypeObject: MediaTypeObject = { schema: { type: "object" } }; |
You need to import MediaTypeObject from "openapi3-ts/oas30";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabien0102
Thank you for reviewing it so quickly.
I’ve made the corrections you pointed out!
fabien0102
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
Summary
Add support for
text/csvmedia type in the TypeScript code generator.Problem
When OpenAPI specifications defined endpoints with
text/csvresponses, thefindCompatibleMediaTypefunction did not recognize this media type, resulting inundefinedtypes in the generated TypeScript code.