Skip to content

Commit 568677b

Browse files
Merge pull request #59 from stufisher/differentiate-null-none-types
Differentiate between a type being null and undefined/None
2 parents b5fc4d1 + e4d6ebf commit 568677b

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)