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
from openapi_client.model import parent
parent.Parent._from_openapi_data(test_readonly="foobar")
<snip>
openapi_client.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'Child'. The input data was invalid for the allOf schema 'Child' in the composed schema 'Parent'. Error=`test_readonly` is a read-only attribute. Use `from_openapi_data` to instantiate class with read only attributes.
Related issues/PRs
Suggest a fix
I made a quick fix to model_utils.mustache as follows:
But likely inappropriate since it now always calls from_openapi_data, but rather it should likely use either__init_ or _from_openapi_data depending on the caller.
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
This is related specifically to the python generator.
Here is an example schema:
openapi-generator version
master
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
I made a quick fix to model_utils.mustache as follows:
mfmarche@eb28082#diff-5378d085f86e7e92f3e0044670bce659d30efdfe1f0c31a502b5da22ba6e2070R1458
But likely inappropriate since it now always calls from_openapi_data, but rather it should likely use either__init_ or _from_openapi_data depending on the caller.
The text was updated successfully, but these errors were encountered: