openapi-ts
openapi-ts copied to clipboard
Add JSDOC tags to generated type declarations
Description
The type declarations generated by openapi-ts are very good.
They would be even more useful if they had JSDOC tags.
The information for JSDOC tags is readily available in an OpenAPI spec. This would open the door to using the output with tools that can consume JSDOC tags - such as documentation generation - tooltips in the IDE
Hey @robogeek can you provide a specific example where the generated code falls short and what you'd expect to see?
I'm also interested in this feature. I use ts-to-zod to generate zod schemas based on openapi-ts generated types. Since there are no jsdoc tags in the output I'm not getting validators or defaults in my zod schemas.
Funny timing, I just saw this PR @mrlubos - https://github.com/hey-api/openapi-ts/pull/1127
@sberryman-mh I swear that's how it goes every time haha. Want to help me beta test https://github.com/hey-api/openapi-ts/issues/876?
@mrlubos - I'm happy to help test it. I do use ts-to-zod config, specifically nameFilter as I don't need (name.endsWith OpenApiTs, Response and Error schemas)
Is the approach to bring this in-house vs instructing users to use ts-to-zod (while adding jsdoc tags) easier in the long run? That project has a pretty good following
@sberryman-mh Which OpenAPI version are you on?
@mrlubos 3.1 - most of our backend API's are in python/FastAPI