Skip to content

Commit 7cd3b65

Browse files
authored
handle maps (#2920)
1 parent 7581d39 commit 7cd3b65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.generator/src/generator/formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def format_data_with_schema_dict(
605605
return _format_oneof(schema, data, name, default_name, replace_values, imports)
606606

607607
# NOTE this is a special case for unnamed objects that should be avoided in the future
608-
if schema.get("type") == "object" and not data:
608+
if schema.get("type") == "object" and not data and "additionalProperties" not in schema:
609609
return "Object", "new Object()", set()
610610

611611
if schema.get("type") == "object" and "properties" not in schema and schema.get("additionalProperties") == {}:

0 commit comments

Comments
 (0)