OpenAPI
The development flow of a Multijet project is based around the OpenAPI definition file, located in configs/openapi.json
.
To know more about OpenAPI, head to the official specification.
Multijet only supports OpenAPI version 3.x
Code generation
To generate all the required models from the OpenAPI file, simply run this command in the root of your project:
This script will generate all the Typescript interfaces and models based on the API definition, including:
Component schemas
Path and query params
Requests and responses body
Routes
The base schemas are generated in libs/models
and can be imported from anywhere by just installing @libs/models
. Everything else are Fastify
specific types and located in libs/fastify-utils/generated
.
The generated files are ignored by Git and should never be included in the repository.
Last updated