Generates a JSON schema that matches a function-before schema. Args: schema: The core schema. Returns: The generated JSON schema.
(self, schema: core_schema.BeforeValidatorFunctionSchema)
| 1116 | return json_schema |
| 1117 | |
| 1118 | def function_before_schema(self, schema: core_schema.BeforeValidatorFunctionSchema) -> JsonSchemaValue: |
| 1119 | """Generates a JSON schema that matches a function-before schema. |
| 1120 | |
| 1121 | Args: |
| 1122 | schema: The core schema. |
| 1123 | |
| 1124 | Returns: |
| 1125 | The generated JSON schema. |
| 1126 | """ |
| 1127 | if self.mode == 'validation' and (input_schema := schema.get('json_schema_input_schema')): |
| 1128 | return self.generate_inner(input_schema) |
| 1129 | |
| 1130 | return self.generate_inner(schema['schema']) |
| 1131 | |
| 1132 | def function_after_schema(self, schema: core_schema.AfterValidatorFunctionSchema) -> JsonSchemaValue: |
| 1133 | """Generates a JSON schema that matches a function-after schema. |
nothing calls this directly
no test coverage detected