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

about from_json and to_json function #717

Closed
daodol opened this issue Aug 28, 2017 · 2 comments
Closed

about from_json and to_json function #717

daodol opened this issue Aug 28, 2017 · 2 comments
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@daodol
Copy link

daodol commented Aug 28, 2017

Hi,
Do I need to design functions for each custom type?
Thx

@nlohmann
Copy link
Owner

Yes

@theodelrieu
Copy link
Contributor

If a lot of your types share a custom property/interface, you could partially specialize adl_serializer, and use enable_if to only write the code once.

But for regular application types, it is needed to define one from_json/to_json pair for each one.

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants