MCPcopy
hub / github.com/pydantic/pydantic / frozenset_schema

Method frozenset_schema

pydantic/json_schema.py:1039–1048  ·  view source on GitHub ↗

Generates a JSON schema that matches a frozenset schema. Args: schema: The core schema. Returns: The generated JSON schema.

(self, schema: core_schema.FrozenSetSchema)

Source from the content-addressed store, hash-verified

1037 return self._common_set_schema(schema)
1038
1039 def frozenset_schema(self, schema: core_schema.FrozenSetSchema) -> JsonSchemaValue:
1040 """Generates a JSON schema that matches a frozenset schema.
1041
1042 Args:
1043 schema: The core schema.
1044
1045 Returns:
1046 The generated JSON schema.
1047 """
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'])

Callers 15

_frozenset_schemaMethod · 0.80
test_frozenset_anyFunction · 0.80
test_frozenset_anyFunction · 0.80
test_no_copyFunction · 0.80
test_reprFunction · 0.80
test_generator_errorFunction · 0.80

Calls 1

_common_set_schemaMethod · 0.95

Tested by 15

test_frozenset_anyFunction · 0.64
test_frozenset_anyFunction · 0.64
test_no_copyFunction · 0.64
test_reprFunction · 0.64
test_generator_errorFunction · 0.64