List#
Using decorators is a very clear way to describe your entities an can be used in many means. For example : how properties are exposed, validated, which have dedicated endpoints, etc.
Although we heavily rely on the use of decorators with entity-routes
, there are only 8 built-in decorators right now,
and you should mostly just use the first three here :
Definition | Kind | Description- | Learn more |
---|---|---|---|
@EntityRoute | ClassDecorator | Register an EntityRouter for the decorated @Entity . | Usage |
@Groups | PropertyDecorator / MethodDecorator | Expose a property/method through a route scope . | Groups |
@Subresource | PropertyDecorator | Generates a dedicated endpoint (with auto database joins) for a property. | Subresources |
@DependsOn | MethodDecorator | Allows to list dependencies (others entity properties) needed for that method to run properly. | Computed properties |
@MaxDepth | ClassDecorator / PropertyDecorator | Sets a max depth on the decorated property or every properties of the decorated entity. | TODO |
@Search | ClassDecorator | Register the SearchFilter for the decorated entity. | SearchFilter |
@Pagination | ClassDecorator | Allow ordering a property. | PaginationFilter |
@OrderBy | PropertyDecorator | Register a property for PaginationFilter & allow specifiying default OrderDirection & which nested property should be used for ordering. | TODO |