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(
213213 parameters = ""
214214 if "properties" in schema :
215215 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" ]
216220 value , extra_imports = format_data_with_schema (
217221 v ,
218- schema [ "properties" ][ k ] ,
222+ sub_schema ,
219223 replace_values = replace_values ,
220224 default_name = name + camel_case (k ) if name else None ,
221225 version = version ,
222226 )
223227 parameters += f"{ escape_reserved_keyword (safe_snake_case (k ))} ={ value } , "
224228 imports = _merge_imports (imports , extra_imports )
225229
226- if schema .get ("additionalProperties" ):
230+ if schema .get ("additionalProperties" ) and not schema . get ( "properties" ) :
227231 for k , v in data .items ():
228232 value , extra_imports = format_data_with_schema (
229233 v ,
You can’t perform that action at this time.
0 commit comments