Skip to content

Commit e4d6ebf

Browse files
committed
differentiate between a type being null and undefined/None
1 parent b5fc4d1 commit e4d6ebf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/openapi_python_generator/language_converters/python/model_generator.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ def type_converter( # noqa: C901
163163
converted_type = retVal + "]" + post_type
164164
elif schema.type == "object":
165165
converted_type = pre_type + "Dict[str, Any]" + post_type
166-
elif schema.type is None or schema.type == "null":
166+
elif schema.type == "null":
167167
converted_type = pre_type + "None" + post_type
168+
elif schema.type is None:
169+
converted_type = pre_type + "Any" + post_type
168170
else:
169171
raise TypeError(f"Unknown type: {schema.type}")
170172

0 commit comments

Comments
 (0)