MCPcopy
hub / github.com/pydantic/pydantic / _common_set_schema

Method _common_set_schema

pydantic/json_schema.py:1050–1054  ·  view source on GitHub ↗
(self, schema: core_schema.SetSchema | core_schema.FrozenSetSchema)

Source from the content-addressed store, hash-verified

1048 return self._common_set_schema(schema)
1049
1050 def _common_set_schema(self, schema: core_schema.SetSchema | core_schema.FrozenSetSchema) -> JsonSchemaValue:
1051 items_schema = {} if 'items_schema' not in schema else self.generate_inner(schema['items_schema'])
1052 json_schema = {'type': 'array', 'uniqueItems': True, 'items': items_schema}
1053 self.update_with_validations(json_schema, schema, self.ValidationsMapping.array)
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.

Callers 2

set_schemaMethod · 0.95
frozenset_schemaMethod · 0.95

Calls 2

generate_innerMethod · 0.95

Tested by

no test coverage detected