entity-routes logo
Docs

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 :

DefinitionKindDescription-Learn more
@EntityRouteClassDecoratorRegister an EntityRouter for the decorated @Entity.Usage
@GroupsPropertyDecorator / MethodDecoratorExpose a property/method through a route scope.Groups
@SubresourcePropertyDecoratorGenerates a dedicated endpoint (with auto database joins) for a property.Subresources
@DependsOnMethodDecoratorAllows to list dependencies (others entity properties) needed for that method to run properly.Computed properties
@MaxDepthClassDecorator / PropertyDecoratorSets a max depth on the decorated property or every properties of the decorated entity.TODO
@SearchClassDecoratorRegister the SearchFilter for the decorated entity.SearchFilter
@PaginationClassDecoratorAllow ordering a property.PaginationFilter
@OrderByPropertyDecoratorRegister a property for PaginationFilter & allow specifiying default OrderDirection & which nested property should be used for ordering.TODO
Prev
Making a custom filter
Next
@EntityRoute