Use pydantic, or msgspec, for validation+serialization+OpenAPI spec generation
See https://docs.pydantic.dev (https://docs.pydantic.dev/usage/settings/ for the config)

Alternative: https://jcristharif.com/msgspec/

Usages:
- validate query parameters in API endpoints
- validate data fetched from the database (we do it manually, in case some data are malformed)
- serialize the API responses to JSON (we use orjson)
- generate JSON schema (ie OpenAPI spec) from code
- use constraints in validation (>0, etc)
Use pydantic, or msgspec, for validation+serialization+OpenAPI spec generation: See https://docs.pydantic.dev (https://docs.pydantic.dev/usage/settings/ for the config)

Alternative: https://jcristharif.com/msgspec/

Usages:
- validate query parameters in API endpoints
- validate data fetched from the database (we do it manually, in case some data are malformed)
- serialize the API responses to JSON (we use orjson)
- generate JSON schema (ie OpenAPI spec) from code
- use constraints in validation (>0, etc)