according to nest.js
official documents, request parameter verification is implemented using class-validator
and pipe
, but
can only be fully verified according to the rules defined when the entity is defined, that is, the verification rules in the entity must be fully satisfied each time.
in fact, more requirements are that all rules must be checked when added, and only validated against the request parameters when modified (for example, if only one field is modified and the request parameter is this field, only that field will be verified. ), and no check is required for deletion
refer to some articles and materials and find some useful information: class-validator
comes with Skipping missing properties
, and Entity Listeners and Subscribers
of typeorm
.
but the level is limited, and I don"t know how to achieve it, so I turn to the community gods.
Boss ask for help!