lovasoa / marshmallow_dataclass

Automatic generation of marshmallow schemas from dataclasses.
https://lovasoa.github.io/marshmallow_dataclass/html/marshmallow_dataclass.html
MIT License
456 stars 78 forks source link

Add native marshmallow.fields.Enum suport #225

Closed uvsmtid closed 1 year ago

uvsmtid commented 1 year ago

Enum support was added by marshmallow v3.18.0: https://github.com/marshmallow-code/marshmallow/commit/fa0ee03e82d2b73dc00bdeb75b266aba99be8d0b

EnumField from marshmallow-enum becomes unnecessary: https://github.com/justanr/marshmallow_enum/issues/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.

dairiki commented 1 year ago

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