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

Json.deserializeWith support? #66

Open
ninjarobot opened this issue May 20, 2016 · 4 comments
Open

Json.deserializeWith support? #66

ninjarobot opened this issue May 20, 2016 · 4 comments

Comments

@ninjarobot
Copy link
Collaborator

I have some types that are out of my control and I can add a custom SomeTypeToJson and SomeTypeFromJson functions. Serialization works fine using Json.serializeWith but I've looked through the source and tests and just don't see how to use my custom deserializer. A Json.deserializeWith function would make sense, but I really don't see anything like that or any other way to use it so I think I'm just missing it. Can you point me in the right direction, please?

@kolektiv
Copy link
Member

Yes you're right, the serializeWith functions were contributions, but I've not got round to adding the equivalent deserialization logic. It would definitely be a good thing to have! Sadly you're not missing it. It's probably not a big change, but I'm probably not able to add it in the next couple of weeks, as I've got a lot of commitments on other things. I'll likely get to it in the next couple of weeks though now you've raised it.

If you want to have a stab at adding the appropriate functions I'll do my best to give useful feedback and answer questions, otherwise I'll get to it ASAP!

@haf
Copy link
Contributor

haf commented Nov 3, 2016

Being able to extract the serialisation logic away from the types would be a great feature; because having it all intermingled becomes very distracting when your domains get larger.

@Arrow7000
Copy link

I've come across this issue after googling Json.deserializeWith. I don't want to pollute my record types with serialization logic, which is why I found the Json.serializeWith function really helpful. It would be really helpful if there was an equivalent for deserialization!

@haf
Copy link
Contributor

haf commented Jun 8, 2018

@neoeinstein Has his chiron-7 branch with this in it.

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

4 participants