You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BUG] java: Map<String, Object>, to openapi spec: "additionalProperties": { "type": "object" }, after generated python client, most of the types can't handle #15839
in java:
class Tag{
Map<String, Object> attributes;
}
to openapi spec:
{"attributes": { "type": "object",
"additionalProperties": {
"type": "object"
} }
after generated python client, most of the types can't handle
openapi.json is exactly the content i have pasted above.
Steps to reproduce
import unittest
from openapi_client.models.tag import Tag
class MyTestCase(unittest.TestCase):
def test_tag(self):
tag = Tag();
print(Tag.to_json(tag))
json = '{"attributes":{"height":1}}'
tag1 = Tag.from_json(json)
print("data_class_instance=", tag1)
if name == "main":
unittest.main()
above case will fail by reporting:
File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for Tag
attributes -> height
value is not a valid dict (type=type_error.dict)