lovasoa / marshmallow_dataclass

Automatic generation of marshmallow schemas from dataclasses.

Home Page:https://lovasoa.github.io/marshmallow_dataclass/html/marshmallow_dataclass.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add native marshmallow.fields.Enum suport

uvsmtid opened this issue · comments

Enum support was added by marshmallow v3.18.0:
marshmallow-code/marshmallow@fa0ee03

EnumField from marshmallow-enum becomes unnecessary:
justanr/marshmallow_enum#51

In fact, native support is necessary to generate OAS spec from marshmallow specs using apispec.
This line does not support EnumField from marshmallow-enum, it wants Enum from marshmallow:
https://github.com/marshmallow-code/apispec/blob/bd0d12f7b932369f718d1b222a68f1ddff399953/src/apispec/ext/marshmallow/field_converter.py#L512

Suporting Enum makes all pieces work togeter.

Done via #227. Released, just now, in marshmallow-dataclass 8.5.11.