Skip to main content

@Field

Use @Field for properties exposed in request or response schemas. The decorator infers primitive types from TypeScript metadata and accepts Swagger property options such as description, example, nullable, minLength, maxLength, minimum, maximum, and enum. todo-item-input.dto.ts
For nested objects and arrays, provide an explicit return type:
Set nullable: true on optional update properties. Required fields receive validation metadata by default.

@FilterableField

@FilterableField includes the property in the schema just like @Field and exposes it as an equality query parameter on collection and export endpoints. todo-item.dto.ts
The DTO above accepts requests such as:
Additional filter options include:
  • filterRequired: true makes the query parameter mandatory whenever the generated filter is used.
  • filterOnly: true accepts the property as a filter but excludes it from serialized response fields.
  • filterDecorators applies additional decorators to the generated query property.
  • Standard Field/Swagger options control transformation and validation.

@IDField

@IDField identifies the property used by GET, PUT, and DELETE single-record routes. Declare it on the response DTO so the generated :id parameter is transformed to the correct type.
Use idOnly: true when an identifier should be accepted as a route parameter but omitted from generated mutation bodies.

@QueryOptions

Use @QueryOptions to set collection defaults on the DTO. Endpoint-level options override decorator options.
See filtering and paging for the generated HTTP API. Edit this page