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

Custom JSON marshaller #335

Closed
lhazlewood opened this issue Jul 5, 2018 · 2 comments
Closed

Custom JSON marshaller #335

lhazlewood opened this issue Jul 5, 2018 · 2 comments
Assignees
Milestone

Comments

@lhazlewood
Copy link
Contributor

lhazlewood commented Jul 5, 2018

JJWT's internal Jackson marshaller is ... internal. It can't be modified or replaced by JJWT users.

This issue represents the work to:

  1. Create a new JsonConverter (or similarly named) interface. Instances of this interface perform the JSON work.

  2. Create multiple maven modules in the JJWT project. The current code would go under a new module, jjwt-core. or jjwt-api (haven't decided yet).

  3. Create a new maven module jjwt-orgjson as the default implementation of the JsonConverter interface using the org.json APIs (these are only ~ 50k of size compared to jackson-core's 360k, and Android already has org.json support, so no need to include that dependency in those environments.

  4. Create a new maven module jjwt-jackson that uses the Jackson API to implement JsonConverter for people that like using Jackson.

  5. Create a new maven module jjwt that is nothing more than a dependency of (jjwt-core|jjwt-api) and jjwt-orgjson to ensure anyone depending on just jjwt gets JJWT with the default json parser.

  6. Allow specifying the JsonConverter on JwtParser and JwtBuilder instances to allow users to choose whatever JSON implementation they want.

  7. If a user doesn't specify a JwtConverter go through class/env discovery logic to find and use the first one available, if possible.

@lhazlewood lhazlewood changed the title Allow for Custom JSON marshaller Custom JSON marshaller Jul 5, 2018
@lhazlewood lhazlewood added this to the 1.0 milestone Jul 5, 2018
@lhazlewood lhazlewood modified the milestones: 1.0, 0.10.0 Jul 5, 2018
@lhazlewood lhazlewood self-assigned this Jul 9, 2018
@lhazlewood
Copy link
Contributor Author

Module splitting work has been extracted to #348. This issue depends on #348 completion first.

@lhazlewood
Copy link
Contributor Author

#348 has been completed and merged to master and this issue is now effectively complete. #354 however may introduce further changes to these modifications.

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

No branches or pull requests

1 participant