Returns a schema that matches a list schema. Args: schema: The core schema. Returns: The generated JSON schema.
(self, schema: core_schema.ListSchema)
| 955 | return self.handle_invalid_for_json_schema(schema, 'core_schema.CallableSchema') |
| 956 | |
| 957 | def list_schema(self, schema: core_schema.ListSchema) -> JsonSchemaValue: |
| 958 | """Returns a schema that matches a list schema. |
| 959 | |
| 960 | Args: |
| 961 | schema: The core schema. |
| 962 | |
| 963 | Returns: |
| 964 | The generated JSON schema. |
| 965 | """ |
| 966 | items_schema = {} if 'items_schema' not in schema else self.generate_inner(schema['items_schema']) |
| 967 | json_schema = {'type': 'array', 'items': items_schema} |
| 968 | self.update_with_validations(json_schema, schema, self.ValidationsMapping.array) |
| 969 | return json_schema |
| 970 | |
| 971 | @deprecated('`tuple_positional_schema` is deprecated. Use `tuple_schema` instead.', category=None) |
| 972 | @final |