A fast multiplexing schema for marshmallow that dispatches deserialization to a subschema based on a discriminator field. Uses schema caching for speed. Current version (2025.9.2.1.dev7) is a development release; requires Python >=3.11.
pip install marshmallow-fastoneofschemaVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: define a FastOneOfSchema with a discriminator field and subschemas.
Ensure each input dict contains the discriminator field with a valid value.
Define `type_schemas` as a class variable or set it before any call to load/dump.
Use `type_field` (without trailing underscore) as the class variable or constructor argument.
Run `pip install --upgrade marshmallow-fastoneofschema` and ensure you have a recent version (>=2025.9.2.1.dev0).
Check that the input contains a valid discriminator value, e.g., one of the keys defined in `type_schemas`.