Handles JSON schema generation for a core schema that checks if a value is an instance of a class. Unless overridden in a subclass, this raises an error. Args: schema: The core schema. Returns: The generated JSON schema.
(self, schema: core_schema.IsInstanceSchema)
| 915 | return result |
| 916 | |
| 917 | def is_instance_schema(self, schema: core_schema.IsInstanceSchema) -> JsonSchemaValue: |
| 918 | """Handles JSON schema generation for a core schema that checks if a value is an instance of a class. |
| 919 | |
| 920 | Unless overridden in a subclass, this raises an error. |
| 921 | |
| 922 | Args: |
| 923 | schema: The core schema. |
| 924 | |
| 925 | Returns: |
| 926 | The generated JSON schema. |
| 927 | """ |
| 928 | return self.handle_invalid_for_json_schema(schema, f'core_schema.IsInstanceSchema ({schema["cls"]})') |
| 929 | |
| 930 | def is_subclass_schema(self, schema: core_schema.IsSubclassSchema) -> JsonSchemaValue: |
| 931 | """Handles JSON schema generation for a core schema that checks if a value is a subclass of a class. |