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

Register custom Gson Type adapter #542

Open
mynecker opened this issue Jul 3, 2018 · 2 comments
Open

Register custom Gson Type adapter #542

mynecker opened this issue Jul 3, 2018 · 2 comments

Comments

@mynecker
Copy link

mynecker commented Jul 3, 2018

It would be helpful to be able to register custom Gson-Type adapters [1] for serialization and deserialization of Json payloads.

Gson gson = new GsonBuilder().registerTypeAdapter(MyClass.class, new MyAdapter()).create();

[1] https://google.github.io/gson/apidocs/com/google/gson/TypeAdapter.html

@this
Copy link
Member

this commented Oct 2, 2018

@mynecker Currently we don't have any plans on implementing this. As a workaround, you can call Gson by yourself and then set the output JSON string to the response.

@inem88
Copy link

inem88 commented Oct 11, 2018

I found solution for custom format fields, for example OffsetDateTime. See #415 (comment)

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

3 participants