Update the json_schema with the corresponding validations specified in the core_schema, using the provided mapping to translate keys in core_schema to the appropriate keys for a JSON schema. Args: json_schema: The JSON schema to update. core_schema: The core
(
self, json_schema: JsonSchemaValue, core_schema: CoreSchema, mapping: dict[str, str]
)
| 2359 | ) |
| 2360 | |
| 2361 | def update_with_validations( |
| 2362 | self, json_schema: JsonSchemaValue, core_schema: CoreSchema, mapping: dict[str, str] |
| 2363 | ) -> None: |
| 2364 | """Update the json_schema with the corresponding validations specified in the core_schema, |
| 2365 | using the provided mapping to translate keys in core_schema to the appropriate keys for a JSON schema. |
| 2366 | |
| 2367 | Args: |
| 2368 | json_schema: The JSON schema to update. |
| 2369 | core_schema: The core schema to get the validations from. |
| 2370 | mapping: A mapping from core_schema attribute names to the corresponding JSON schema attribute names. |
| 2371 | """ |
| 2372 | for core_key, json_schema_key in mapping.items(): |
| 2373 | if core_key in core_schema: |
| 2374 | json_schema[json_schema_key] = core_schema[core_key] |
| 2375 | |
| 2376 | class ValidationsMapping: |
| 2377 | """This class just contains mappings from core_schema attribute names to the corresponding |
no test coverage detected