Description
Without this, DTO validation decorators (class-validator) on request bodies/queries do nothing — this one line is what makes them actually enforce.
Where
astre_server/src/main.ts
What to implement
app.useGlobalPipes(new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true }));
added before app.listen(...).
Acceptance Criteria
Hints
- This is a one-line change but unblocks the acceptance criteria of several other issues (like "Implement
PoolsController GET /pools"'s 400-on-invalid-status requirement) — worth doing early.
Description
Without this, DTO validation decorators (
class-validator) on request bodies/queries do nothing — this one line is what makes them actually enforce.Where
astre_server/src/main.tsWhat to implement
added before
app.listen(...).Acceptance Criteria
main.tsclass-validatordecorators, e.g.GET /pools?status=NotARealStatus) now returns400instead of passing through unvalidatednpm run buildcompiles cleanlyHints
PoolsControllerGET /pools"'s 400-on-invalid-statusrequirement) — worth doing early.