marshmallow-jsonapi icon indicating copy to clipboard operation
marshmallow-jsonapi copied to clipboard

Support for polymorphic relationships

Open buckmaxwell opened this issue 3 years ago • 0 comments

It is desirable to be able to include a collection of resources that may inherit from one type, but have different types. This is both supported by the JSON API spec, and by many front end frameworks that implement it like ember which provides this excellent use case.

The change here is to allow for users to define a type_ attribute on the serialized instance that takes preference over a type defined with the type_ key. This results in no behavior changes for existing functionality, and should be considered backward compatible.

Thank you everyone for you work on this; I am making use of this library and am a big fan.

buckmaxwell avatar Feb 25 '21 20:02 buckmaxwell