Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use serialization classes instead of functions #510

Merged
merged 1 commit into from
Apr 28, 2016
Merged

Conversation

jfinkels
Copy link
Owner

@jfinkels jfinkels commented Apr 4, 2016

Fixes issue #499. This allows users to use the https://marshmallow-jsonapi.readthedocs.org/en/latest/index.html library.

This is very non-backwards compatible; users will have to change their custom serialization and change how they invoke APIManager.create_api.

Serialization and deserialization is now done using serializer and
deserializer classes. The former has a `serialize()` and
`serialize_many()`, each of which produces a full JSON API document as a
Python dictionary. The latter class has a `deserialize()` method, which
receives a full JSON API document as input. Before, the serialization
functions sent and received only the primary data.

This commit also
- organizes the (de-)serialization code in a new `serialization`
  subpackage,
- moves various serialization code out of the `views` package and into
  the `serialization` package,
- updates the marshmallow example to the new JSON API format,
- allows the user to better generate serialization exceptions in custom
  serializers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant