Skip to content

Commit 998f607

Browse files
authored
Fix type of nullable additionalProperties (#926)
1 parent 08ea352 commit 998f607

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.generator/src/generator/openapi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ def type_to_python(schema, alternative_name=None):
5050
return "[{}]".format(type_to_python(schema["items"]))
5151
elif type_ == "object":
5252
if "additionalProperties" in schema:
53-
return "{{str: ({},)}}".format(type_to_python(schema["additionalProperties"]))
53+
nested_schema = schema["additionalProperties"]
54+
nested_name = type_to_python(nested_schema)
55+
if nested_schema.get("nullable"):
56+
nested_name += ", none_type"
57+
return "{{str: ({},)}}".format(nested_name)
5458
return (
5559
alternative_name
5660
if alternative_name

src/datadog_api_client/v1/model/monitor_options.py

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)