(OpenAPI) Documentation process
AuthentifyIT - LifePass Studio - Backend - NestJS
Once your development is done and correctly documented thanks to this documentation, please check the documentation here
Document the backend
We are using OpenAPI structure to automatically document our APIs. To do so, please read the bellow informations to correctly document your code once its finished.
Controllers endpoints
Add these Middlewares (if needed):
@ApiTags('XXX') // Put above the controller to structure the documentation@ApiOperation({
summary: 'Explain the endpoint main action',
})@ApiOkResponse({
schema: {
type: 'any' (boolean, string, number, ...),
},
})
OR
@ApiOkResponse({
schema: schemaFromType('YOUR TYPE | INTERFACE'),
})Database schemas
If you changed an existing schema, just check in the documentation the updates appears
If you add a new schema, add this schema into the file:
src > mongo > schemas > doc-schemas.ts
The name of the schema in the doc file should be 'Database:XXX'
Last updated