File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -110,12 +110,18 @@ def add_custom_objects_spec(spec):
110
110
spec ['paths' ][path ] = custom_objects_spec [path ]
111
111
return spec
112
112
113
+ def add_codegen_request_body (operation , _ ):
114
+ if 'parameters' in operation and len (operation ['parameters' ]) > 0 :
115
+ if operation ['parameters' ][0 ].get ('in' ) == 'body' :
116
+ operation ['x-codegen-request-body-name' ] = 'body'
113
117
114
118
def process_swagger (spec , client_language ):
115
119
spec = add_custom_objects_spec (spec )
116
120
117
121
apply_func_to_spec_operations (spec , strip_tags_from_operation_id )
118
122
123
+ apply_func_to_spec_operations (spec , add_codegen_request_body )
124
+
119
125
operation_ids = {}
120
126
apply_func_to_spec_operations (spec , lambda op , _ : operator .setitem (
121
127
operation_ids , op ['operationId' ], op ))
@@ -295,7 +301,7 @@ def main():
295
301
)
296
302
argparser .add_argument (
297
303
'output_spec_path' ,
298
- help = 'Path to otput spec file to'
304
+ help = 'Path to output spec file to'
299
305
)
300
306
argparser .add_argument (
301
307
'username' ,
You can’t perform that action at this time.
0 commit comments