Returns a JSON schema that represents the provided GeneratorSchema. Args: schema: The schema. Returns: The generated JSON schema.
(self, schema: core_schema.GeneratorSchema)
| 1054 | return json_schema |
| 1055 | |
| 1056 | def generator_schema(self, schema: core_schema.GeneratorSchema) -> JsonSchemaValue: |
| 1057 | """Returns a JSON schema that represents the provided GeneratorSchema. |
| 1058 | |
| 1059 | Args: |
| 1060 | schema: The schema. |
| 1061 | |
| 1062 | Returns: |
| 1063 | The generated JSON schema. |
| 1064 | """ |
| 1065 | items_schema = {} if 'items_schema' not in schema else self.generate_inner(schema['items_schema']) |
| 1066 | json_schema = {'type': 'array', 'items': items_schema} |
| 1067 | self.update_with_validations(json_schema, schema, self.ValidationsMapping.array) |
| 1068 | return json_schema |
| 1069 | |
| 1070 | def dict_schema(self, schema: core_schema.DictSchema) -> JsonSchemaValue: |
| 1071 | """Generates a JSON schema that matches a dict schema. |