(self, schemas: list[JsonSchemaValue])
| 2406 | } |
| 2407 | |
| 2408 | def get_flattened_anyof(self, schemas: list[JsonSchemaValue]) -> JsonSchemaValue: |
| 2409 | members = [] |
| 2410 | for schema in schemas: |
| 2411 | if len(schema) == 1 and 'anyOf' in schema: |
| 2412 | members.extend(schema['anyOf']) |
| 2413 | else: |
| 2414 | members.append(schema) |
| 2415 | members = _deduplicate_schemas(members) |
| 2416 | if len(members) == 1: |
| 2417 | return members[0] |
| 2418 | return {'anyOf': members} |
| 2419 | |
| 2420 | def get_json_ref_counts(self, json_schema: JsonSchemaValue) -> dict[JsonRef, int]: |
| 2421 | """Get all values corresponding to the key '$ref' anywhere in the json_schema.""" |
no test coverage detected