(schema_type: dict[str, Any], spec: dict[str, Any])
| 49 | |
| 50 | |
| 51 | def resolve_schema(schema_type: dict[str, Any], spec: dict[str, Any]) -> dict[str, Any]: |
| 52 | if "$ref" in schema_type: |
| 53 | schema = schema_type.get("$ref").strip("# /") |
| 54 | ref_schema_type = spec |
| 55 | for step in schema.split("/"): |
| 56 | if step not in ref_schema_type: |
| 57 | raise ValueError(f"Could not find schema in spec: {schema}") |
| 58 | ref_schema_type = ref_schema_type[step] |
| 59 | return ref_schema_type |
| 60 | return schema_type |
| 61 | |
| 62 | |
| 63 | def cst_to_python(value: cst.BaseExpression) -> Any: |
no test coverage detected
searching dependent graphs…