GitHub

FieldOnly

API reference for FieldOnly.

field_only(keys)(schema): schema in the keys variants.

Attributes

AttributeTypeDescription
keys= keys

Functions

__init__

__init__(keys) -> None
ParameterTypeDescription
keystuple[str, ...]
def __init__(self, keys: tuple[str, ...]) -> None:
    self.keys = keys

__call__

__call__[A](schema) -> VariantField[A]
ParameterTypeDescription
schemaCodec[A, Any, Any, Any]

Returns VariantField[A]

def __call__[A](self, schema: Codec[A, Any, Any, Any], /) -> VariantField[A]:
    return VariantField(dict.fromkeys(self.keys, schema))