Skip to Content
DocsNestJS CRUD AutomatorAPI ReferenceDecoratorsProperty DecoratorsProperty Decorators

Property Decorators

Property decorators describe DTO fields, attach Swagger metadata, and generate class-validator/class-transformer rules consistent with the entity definition.

Available decorators

DecoratorPurposeReference
@ApiPropertyDescribeCentral metadata source used by auto DTO generation./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-describe
@ApiPropertyBooleanApplies boolean validation/serialization rules./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-boolean
@ApiPropertyNumberHandles numeric formats, ranges, and array validation./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-number
@ApiPropertyStringCovers dozens of string formats, pattern enforcement, and serialization hints./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-string
@ApiPropertyDateControls timestamp identifiers, serialization, and timezone handling./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-date
@ApiPropertyEnumMaps enum values to Swagger and validation metadata./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-enum
@ApiPropertyObjectDescribes nested object payloads with typed sub-properties./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-object
@ApiPropertyUUIDAdds UUID validation for identifiers and relation fields./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-uuid
@ApiPropertyCopyReuses metadata from entity properties to avoid manual duplication in DTOs./docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-copy
  1. Start with @ApiPropertyDescribe on entities so DTO generation stays centralized.
  2. Apply the property-specific decorators to manual DTOs when fine-grained control is needed.
  3. Use @ApiPropertyCopy to mirror existing metadata onto custom DTOs or nested payloads while preserving auto-context behavior.
Last updated on