marshmallow_enum
marshmallow_enum copied to clipboard
Enum handling for Marshmallow
[OpenApi spec](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) allows defining enumerations, following the [JSON Schema validation](https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1). [Apispec](https://github.com/marshmallow-code/apispec) allows generating such OpenApi spec from Marshmallow schemas. Currently Apispec does not get enumeration information from MarshmallowEnum. It is...
If we have a field that deserializes to an `Enum` but serializes from an object with an enum attribute, will it be easier to let the `dump_by` attribute to be...
fixes #24 This PR adds the key `enum` to the field's metadata which allows [apispec](https://github.com/marshmallow-code/apispec) (and possibly other tools) to extract the valid enum values.
Simply changing [`super(EnumField, self).fail(key, **kwargs)`](https://github.com/justanr/marshmallow_enum/blob/master/marshmallow_enum/__init__.py#L117) to `raise super(EnumField, self).make_error(key, **kwargs)` seems to work for Marshmallow 3 on Python 3 but fails for Python 2, at least when running tox locally....
Problem: Marshmallow_enum.EnumField does not pass the enum as metadata to marshmallow. When used in conjunction with apispec (specifically, the apispec marshmallow extension), this results in EnumFields being converted to a...
Tracking issue to test changes in the field api with marshmallow v3.
Hello! I made a stupid mistake refactoring and didn't realize it. The error message didn't help :) Modified example from front page: ``` from marshmallow import Schema from enum import...