MCPcopy
hub / github.com/pydantic/pydantic / set_schema

Method set_schema

pydantic/json_schema.py:1028–1037  ·  view source on GitHub ↗

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

(self, schema: core_schema.SetSchema)

Source from the content-addressed store, hash-verified

1026 return json_schema
1027
1028 def set_schema(self, schema: core_schema.SetSchema) -> JsonSchemaValue:
1029 """Generates a JSON schema that matches a set schema.
1030
1031 Args:
1032 schema: The core schema.
1033
1034 Returns:
1035 The generated JSON schema.
1036 """
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.

Callers 15

_set_schemaMethod · 0.80
test_set_anyFunction · 0.80
test_set_fallbackFunction · 0.80
test_setFunction · 0.80
test_set_ints_pythonFunction · 0.80
test_set_multiple_errorsFunction · 0.80
test_set_kwargsFunction · 0.80
test_union_set_listFunction · 0.80
test_generator_errorFunction · 0.80

Calls 1

_common_set_schemaMethod · 0.95

Tested by 15

test_set_anyFunction · 0.64
test_set_fallbackFunction · 0.64
test_setFunction · 0.64
test_set_ints_pythonFunction · 0.64
test_set_multiple_errorsFunction · 0.64
test_set_kwargsFunction · 0.64
test_union_set_listFunction · 0.64
test_generator_errorFunction · 0.64
test_set_from_dict_itemsFunction · 0.64