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
{{ message }}
Repository navigation
Nullable top-level object schema with a nested nullable object is dropped #1522
Describe the bug
A schema in components/schemas with type: ["object", "null"] that has a
property which is itself a nullable object is dropped, and the generator
still exits 0. It only prints "Client was generated, but some pieces may be
missing":
Unable to process schema /components/schemas/Inner_type_0:
Invalid property in union <...UntrustedString object ...>
Failure to process schema has resulted in the removal of: {...}
The model Inner_type_0 is not generated, although the client is.
Expected: models Outer, Inner_type_0 and InnerLabelsType0 are generated.
Actual: Inner_type_0 is missing.
Desktop (please complete the following information):
OS: Linux
Python Version: 3.12.3
openapi-python-client version: 0.30.0 (also main at 46a4340)
Additional context
Cause: UnionProperty.build splits a type list into one variant per type and
calls property_from_data for each, but does not forward process_properties or
roots. Variants are therefore built eagerly while the schema is also queued
in models_to_process. The same applies to anyOf/oneOf unions.
Fix: #1518 forwards both arguments through UnionProperty.build.
Activity