Refactors API responses and data schemas
Enhances Swagger API documentation by enabling class-validator shim, recognizing entity DTOs, and adding YAML support for raw definitions. Standardizes error handling by transitioning from RxJS's `NotFoundError` to NestJS's `NotFoundException`. Refactors DTOs and Mongoose schemas across the `Article`, `Taxonomy`, and `Content` modules. This includes renaming DTOs for consistency, integrating `class-transformer` for model-to-DTO conversion, and adding `class-validator` for improved schema validation. The `Content` data model is redesigned to be more flexible, shifting from a fixed site header structure to a dynamic key-label-sections model that embeds taxonomy references. This allows for more generic and configurable content retrieval. Updates `Article` and `Taxonomy` services and controllers to fetch specific items by slug or ID and return properly structured DTOs.
This commit is contained in:
1 parent
f77f5f9543
commit
2f027a361b
16 files changed
+282
-204
No files matched your search
+3
-2
@@ -8,9 +8,10 @@
|
||||
{
|
||||
"name": "@nestjs/swagger",
|
||||
"options": {
|
||||
"classValidatorShim": false,
|
||||
"classValidatorShim": true,
|
||||
"introspectComments": true,
|
||||
"skipAutoHttpCode": true
|
||||
"skipAutoHttpCode": true,
|
||||
"dtoFileNameSuffix": [".dto.ts", ".entity.ts"]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user