Bug Report Checklist
Description
When generating a client from an OAS with a composed model situation (like https://gist.github.com/gbvanrenswoude/1143a79dd6f150931c5c00826f6454a2) the resulting EventModel class does contain wrong information about the possible Models being used:
openapi_client/model/event_model.py
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
return {
'event_payload': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
'correlatie_id': (str,), # noqa: E501
'event_title': (str,), # noqa: E501
}
Where
'event_payload': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
is wrong. This might indicate a composed model serialization bug caused by the use of anyOf in the OAS.
replicate
In order to replicate the situation, save the linked gist as whoof.json.
The command then used is openapi-generator generate -i whoof.json -g python -o resources/whoof_api_client
openapi-generator version
5.3.0
With 5.2.0 the issue exists too, but results in 'event_payload': (dict,), # noqa: E501.
related issues
This might be related to this PR:
Bug Report Checklist
Description
When generating a client from an OAS with a composed model situation (like https://gist.github.com/gbvanrenswoude/1143a79dd6f150931c5c00826f6454a2) the resulting EventModel class does contain wrong information about the possible Models being used:
openapi_client/model/event_model.py
Where
is wrong. This might indicate a composed model serialization bug caused by the use of anyOf in the OAS.
replicate
In order to replicate the situation, save the linked gist as whoof.json.
The command then used is
openapi-generator generate -i whoof.json -g python -o resources/whoof_api_clientopenapi-generator version
5.3.0
With 5.2.0 the issue exists too, but results in
'event_payload': (dict,), # noqa: E501.related issues
This might be related to this PR: