just a test what it takes to integrate zod, nest and open-api-3 (swagger)
For the API we want 3 things:
- a typescript type definition: an interface (preferred) or a class
- a validation mechanism: zod, joi, class-validator, etc.
- an open-api-3 schema
ideally we only want to define everything in one place (single source of truth)
With zod we can get validation and a typescript type-definition.
- We can generate some oapi-schema info from the zod definition
that's what the code in this repo is about - Then we must augment this with additional metadata (e.g. summary, etc.)
- Finally we need a way to pass this to nestjs