frozenset_schema
Returns a schema that matches a frozenset of a given schema, e.g.:
```py
from pydantic_core import SchemaValidator, core_schema
schema = core_schema.frozenset_schema(
items_schema=core_schema.int_schema(), min_length=0, max_length=10
)
v = SchemaValidator(schema)
assert v.validate_python(frozenset(range(3))) == frozenset({0, 1, 2})
```
def frozenset_schema(
items_schema: CoreSchema | None = None,
min_length: int | None = None,
max_length: int | None = None,
fail_fast: bool | None = None,
strict: bool | None = None,
ref: str | None = None,
metadata: dict[str, Any] | None = None,
serialization: SerSchema | None = None
) - > FrozenSetSchema
Returns a schema that matches a frozenset of a given schema.
Parameters
| Name | Type | Description |
|---|---|---|
| items_schema | `CoreSchema | None` = None |
| min_length | `int | None` = None |
| max_length | `int | None` = None |
| fail_fast | `bool | None` = None |
| strict | `bool | None` = None |
| ref | `str | None` = None |
| metadata | `dict[str, Any] | None` = None |
| serialization | `SerSchema | None` = None |
Returns
| Type | Description |
|---|---|
FrozenSetSchema | A core schema object representing a frozenset validation structure. |