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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
An object with nested oneOf in allOf structure generates a class with all properties required, even though the properties under oneOf are in fact optional.
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Mergedrequest
prop3
Field required [type=missing, input_value={'prop1': 10, 'prop2': 20}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.8/v/missing
Try creating Mergedrequest object with only prop1 and prop2 specified
Related issues/PRs
Not found
Suggest a fix
If strict implementation of oneOf for part of the properties may be too complex, maybe just marking them as optional would be enough. The schema validation on the server side will do the trick if someone would try to push prop2 and prop3 together.
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
An object with nested oneOf in allOf structure generates a class with all properties required, even though the properties under oneOf are in fact optional.
From the example schema below the code:
generates following error:
openapi-generator version
7.7.0
OpenAPI declaration file content or url
Generation Details
Just defaults:
Steps to reproduce
Related issues/PRs
Not found
Suggest a fix
If strict implementation of oneOf for part of the properties may be too complex, maybe just marking them as optional would be enough. The schema validation on the server side will do the trick if someone would try to push prop2 and prop3 together.
The text was updated successfully, but these errors were encountered: