Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

20
Anyone know of frameworks that auto-generate OpenAPI/Swagger docs from types?
Post Body

I played around with an upcoming framework in Python called FastAPI where you use classes to specify models for data validation. Simply by specifying route handler parameter types and a response_model it will auto-generate all of the OpenAPI json needed to display in Swagger.

Is there anything like this in TypeScript currently? I've checked out things like Loopback and Adonis (new version has TS support) but from what I can tell, those all require you to write out your own doc json which feels super tedious. I'm not too familiar with stuff like reflection, but I assume it should be possible to auto-generate the OpenAPI json with information inferred from the code? Or is there a technical limitation that I'm not aware of?

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
6,408
Link Karma
1,360
Comment Karma
5,002
Profile updated: 22 hours ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago