Handles composite schema definitions like oneOf, anyOf, and allOf. Calls build_nested_object recursively on the chosen sub-schema or the combined properties.
(schema, value_index=0)
| 311 | return obj |
| 312 | |
| 313 | def handle_composite_schemas(schema, value_index=0): |
| 314 | """ |
| 315 | Handles composite schema definitions like oneOf, anyOf, and allOf. |
| 316 | Calls build_nested_object recursively on the chosen sub-schema or the combined properties. |
| 317 | """ |
| 318 | if 'oneOf' in schema: |
| 319 | return build_nested_object(schema['oneOf'][value_index % len(schema['oneOf'])], value_index) |
| 320 | elif 'anyOf' in schema: |
| 321 | return build_nested_object(schema['anyOf'][value_index % len(schema['anyOf'])], value_index) |
| 322 | elif 'allOf' in schema: |
| 323 | combined_schema = {} |
| 324 | for sub_schema in schema['allOf']: |
| 325 | combined_schema.update(sub_schema.get('properties', {})) |
| 326 | return build_nested_object({'properties': combined_schema}, value_index) |
| 327 | return build_nested_object(schema, value_index) |
| 328 | |
| 329 | def build_array_item(item_schema, value_index=0): |
| 330 | """ |
no test coverage detected