Page Contents

Home > @loopback/metadata

metadata package



| Class | Description | | — | — | | ClassDecoratorFactory | Factory for class decorators | | DecoratorFactory | Base factory class for decorator functions | | MetadataAccessor | A strongly-typed metadata accessor via reflection | | MetadataInspector | Inspector for metadata applied by decorators | | MethodDecoratorFactory | Factory for method decorators | | MethodMultiDecoratorFactory | Factory for an append-array of method-level decorators The metadata for a method is an array. Each item in the array should be a single value, containing a response code and a single spec or Model. This should allow:

 @response(200, MyFirstModel)
 @response(403, [NotAuthorizedReasonOne, NotAuthorizedReasonTwo])
 @response(404, NotFoundOne)
 @response(404, NotFoundTwo)
 @response(409, {schema: {}})
 public async myMethod() {}

In the case that a ResponseObject is passed, it becomes the default for description/content, and if possible, further Models are incorporated as a oneOf: [] array.In the case that a ReferenceObject is passed, it and it alone is used, since references can be external and we cannot oneOf their content.The factory creates and updates an array of items T[], and the getter provides the values as that array. | | MethodParameterDecoratorFactory | Factory for method level parameter decorator. | | NamespacedReflect | | | ParameterDecoratorFactory | Factory for parameter decorators | | PropertyDecoratorFactory | Factory for property decorators |


Interface Description
DecoratorOptions Options for a decorator
DesignTimeMethodMetadata Design time metadata for a method.
InspectionOptions Options for inspection
MetadataMap An object mapping keys to corresponding metadata


Variable Description

Type Aliases

Type Alias Description
DecoratorType Decorator function types
MetadataKey Key for metadata access via reflection