Hacker News new | past | comments | ask | show | jobs | submit login

This is exactly how FastAPI/Pydantic in the Python ecosystem works (and also in Django-ninja for Django).

You compose types representing your request and response shape. Those types validate the API request and it’s response, and also generate the OpenAPI.

Even slight drift between API spec, docs and actual behaviour is impossible in this setup, I couldn’t go back to working any other way!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: