File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -213,17 +213,21 @@ def format_data_with_schema_dict(
213
213
parameters = ""
214
214
if "properties" in schema :
215
215
for k , v in data .items ():
216
+ if k in schema ["properties" ]:
217
+ sub_schema = schema ["properties" ][k ]
218
+ else :
219
+ sub_schema = schema ["additionalProperties" ]
216
220
value , extra_imports = format_data_with_schema (
217
221
v ,
218
- schema [ "properties" ][ k ] ,
222
+ sub_schema ,
219
223
replace_values = replace_values ,
220
224
default_name = name + camel_case (k ) if name else None ,
221
225
version = version ,
222
226
)
223
227
parameters += f"{ escape_reserved_keyword (safe_snake_case (k ))} ={ value } , "
224
228
imports = _merge_imports (imports , extra_imports )
225
229
226
- if schema .get ("additionalProperties" ):
230
+ if schema .get ("additionalProperties" ) and not schema . get ( "properties" ) :
227
231
for k , v in data .items ():
228
232
value , extra_imports = format_data_with_schema (
229
233
v ,
You can’t perform that action at this time.
0 commit comments