@@ -81,7 +81,8 @@ export function requestBody(requestBodySpec?: Partial<RequestBodyObject>) {
81
81
return function ( target : Object , member : string , index : number ) {
82
82
debug ( '@requestBody() on %s.%s' , target . constructor . name , member ) ;
83
83
debug ( ' parameter index: %s' , index ) ;
84
- debug ( ' options: %s' , inspect ( requestBodySpec , { depth : null } ) ) ;
84
+ if ( debug . enabled )
85
+ debug ( ' options: %s' , inspect ( requestBodySpec , { depth : null } ) ) ;
85
86
86
87
// Use 'application/json' as default content if `requestBody` is undefined
87
88
requestBodySpec = requestBodySpec || { content : { } } ;
@@ -95,7 +96,8 @@ export function requestBody(requestBodySpec?: Partial<RequestBodyObject>) {
95
96
96
97
const paramType = paramTypes [ index ] ;
97
98
const schema = resolveSchema ( paramType ) ;
98
- debug ( ' inferred schema: %s' , inspect ( schema , { depth : null } ) ) ;
99
+ if ( debug . enabled )
100
+ debug ( ' inferred schema: %s' , inspect ( schema , { depth : null } ) ) ;
99
101
requestBodySpec . content = _ . mapValues ( requestBodySpec . content , c => {
100
102
if ( ! c . schema ) {
101
103
c . schema = schema ;
@@ -109,7 +111,8 @@ export function requestBody(requestBodySpec?: Partial<RequestBodyObject>) {
109
111
requestBodySpec [ REQUEST_BODY_INDEX ] = index ;
110
112
}
111
113
112
- debug ( ' final spec: ' , inspect ( requestBodySpec , { depth : null } ) ) ;
114
+ if ( debug . enabled )
115
+ debug ( ' final spec: ' , inspect ( requestBodySpec , { depth : null } ) ) ;
113
116
ParameterDecoratorFactory . createDecorator < RequestBodyObject > (
114
117
OAI3Keys . REQUEST_BODY_KEY ,
115
118
requestBodySpec as RequestBodyObject ,
0 commit comments