Page Contents
Home > @loopback/metadata > MetadataInspector > getParameterMetadata
MetadataInspector.getParameterMetadata() method
Get the metadata associated with the given key for a parameter of a given method by index
Signature:
static getParameterMetadata<T>(key: MetadataKey<T, ParameterDecorator>, target: Object, methodName: string, index: number, options?: InspectionOptions): T | undefined;
Parameters
| Parameter | Type | Description |
|---|---|---|
|
key |
MetadataKey<T, ParameterDecorator> |
Metadata key |
|
target |
Object |
Class for static methods or prototype for instance methods |
|
methodName |
string |
Method name. If not present, default to ‘’ to use the constructor |
|
index |
number |
Index of the parameter, starting with 0 |
|
options |
(Optional) Options for inspection |
Returns:
T | undefined