( parserClass: Constructor<BodyParser>, key?: BindingAddress<BodyParser>, )
| 1077 | * @param key - Optional binding address |
| 1078 | */ |
| 1079 | export function createBodyParserBinding( |
| 1080 | parserClass: Constructor<BodyParser>, |
| 1081 | key?: BindingAddress<BodyParser>, |
| 1082 | ): Binding<BodyParser> { |
| 1083 | const address = |
| 1084 | key ?? `${RestBindings.REQUEST_BODY_PARSER}.${parserClass.name}`; |
| 1085 | return Binding.bind<BodyParser>(address) |
| 1086 | .toClass(parserClass) |
| 1087 | .inScope(BindingScope.TRANSIENT) |
| 1088 | .tag(REQUEST_BODY_PARSER_TAG); |
| 1089 | } |
| 1090 | |
| 1091 | /** |
| 1092 | * The form of OpenAPI specs to be served |