UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

129 lines (62 loc) 2.1 kB
--- lang: en title: 'API docs: metadata.metadatainspector.getparametermetadata' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/metadata permalink: /doc/en/lb4/apidocs.metadata.metadatainspector.getparametermetadata.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/metadata](./metadata.md) &gt; [MetadataInspector](./metadata.metadatainspector.md) &gt; [getParameterMetadata](./metadata.metadatainspector.getparametermetadata.md) ## MetadataInspector.getParameterMetadata() method Get the metadata associated with the given key for a parameter of a given method by index **Signature:** ```typescript static getParameterMetadata<T>(key: MetadataKey<T, ParameterDecorator>, target: Object, methodName: string, index: number, options?: InspectionOptions): T | undefined; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> key </td><td markdown="1"> [MetadataKey](./metadata.metadatakey.md)<!-- -->&lt;T, ParameterDecorator&gt; </td><td markdown="1"> Metadata key </td></tr> <tr><td markdown="1"> target </td><td markdown="1"> Object </td><td markdown="1"> Class for static methods or prototype for instance methods </td></tr> <tr><td markdown="1"> methodName </td><td markdown="1"> string </td><td markdown="1"> Method name. If not present, default to '' to use the constructor </td></tr> <tr><td markdown="1"> index </td><td markdown="1"> number </td><td markdown="1"> Index of the parameter, starting with 0 </td></tr> <tr><td markdown="1"> options </td><td markdown="1"> [InspectionOptions](./metadata.inspectionoptions.md) </td><td markdown="1"> _(Optional)_ Options for inspection </td></tr> </tbody></table> **Returns:** T \| undefined