{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/4"}],"enrichment":{"capability":"Adds union field support to marshmallow, allowing a single field to deserialize and serialize values that match any of several candidate field types.","skillfed_tags":["marshmallow-plugin","schema-validation"],"use_cases":["Accept API payloads where a field may be either an integer ID or a full object representation","Handle legacy data where a field type changed over time but both formats must be supported","Deserialize configuration files with flexible value types across multiple formats","Build schemas that tolerate multiple input formats without explicit type conversion logic","Serialize polymorphic data structures where the same logical field holds different types"],"what_it_does":"marshmallow-union extends marshmallow's schema validation by providing a Union field that can accept multiple field types. Instead of defining a schema field as strictly one type, you pass a list of candidate fields, and the union tries each one in order during deserialization and serialization, using the first field that succeeds without raising an error.\n\nThe library is straightforward but has a documented caveat: because it relies on trial-and-error field matching rather than type inspection, field order matters and unexpected type coercion can occur. The documentation notes that an Integer field accepting string representations will deserialize string inputs as integers. The package suggests marshmallow-polyfield as an alternative if you need stricter type control.","worth_installing":"Yes, if you are already using marshmallow and need union field support with low friction. The package is stable and permissively licensed, but be aware that it has not been actively maintained since 2020 and relies on field-order heuristics rather than strict type matching\u2014test your specific use case carefully, especially if field order could cause unexpected coercion."},"id":"marshmallow-union","links":{"html":"https://skillfed.io/packages/marshmallow-union","md":"https://skillfed.io/packages/marshmallow-union.md","pypi":"https://pypi.org/project/marshmallow-union/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2020-06-24","license_spdx":null,"license_treatment":"permissive","name":"marshmallow-union","python_support":"unspecified","summary":"Union fields for marshmallow."},"popularity":{"monthly_downloads":1182494,"position":4254,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.1.15.post1"}
