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

Add support for custom json serializer #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dizballanze
Copy link

@dizballanze dizballanze commented Nov 6, 2019

Added support for custom JSON serializers.
This allows to use more efficient JSON serializers like orjson or ujson

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.34% when pulling a3feebc on dizballanze:master into 39f0ee6 on GehirnInc:master.

Copy link
Member

@yosida95 yosida95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dizballanze Thank you for your contribution!

I think supporting custom JSON implementation is a good idea. But I also think passing loads and dumps every calls of #decode and #encode is troublesome and the users want custom JSON implementation don't switch between the standard JSON and the custom JSON for the each calls.

So, defining json_loads = json.loads and json_dumps = json.dumps as a class variable on JWT and overriding them by an instance variable on the constructer is better. How do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants