marshmallow_enum icon indicating copy to clipboard operation
marshmallow_enum copied to clipboard

Add metadata for apispec compatibility

Open Birne94 opened this issue 7 years ago • 3 comments
trafficstars

fixes #24

This PR adds the key enum to the field's metadata which allows apispec (and possibly other tools) to extract the valid enum values.

Birne94 avatar Aug 15 '18 15:08 Birne94

It would be nice if we could get this merged. I am having troubles getting EnumField to work correctly currently with apispec.

TypeError: 'MyEnum' object is not subscriptable

vpassapera avatar Feb 26 '19 22:02 vpassapera

Could you please merge this PR? We're also running into this same issue of being unable to export Enum values using apispec and marshmallow_dataclass. Would be fantastic to have this!

h avatar Mar 12 '20 19:03 h

I added a fork (based on #25) that fixes this issue (while removing the load_by/dump_by ambiguity) at https://github.com/h/marshmallow_enum

This issue hasn't been merged since 2018 -- so if anyone else needs support for APISpec with marshmallow, simply run:

$ pip install -e git+https://github.com/h/marshmallow_enum#egg=marshmallow-enum

h avatar Mar 12 '20 20:03 h