-
Notifications
You must be signed in to change notification settings - Fork 46
Add support for decoding missing record fields to Nothing #93
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 decoding missing record fields to Nothing #93
Conversation
This is an interesting suggestion. From my reading, we're essentially moving from using purescript-argonaut-codecs/src/Data/Argonaut/Decode/Decoders.purs Lines 203 to 213 in 9ce8e17
to attempting to use purescript-argonaut-codecs/src/Data/Argonaut/Decode/Decoders.purs Lines 215 to 224 in 9ce8e17
I'm intrigued, but this would be a significant change so I'd like to leave this open for a time to allow some discussion. Thank you for taking the time to write this up! |
Anything we can do to see this go through? Would love to use argonaut records directly for simple web api’s. |
I'll leave this open for a little while to let other maintainers weigh in, but if I haven't merged it in a week please ping me and I will @jvliwanag -- thanks! |
I'm fine with it - I probably wouldn't choose to have it work this way personally if I was designing a library from scratch, as I don't think you can distinguish between the field missing and having no value present now, right? But |
Are we good with this @thomashoneyman ? :) On a side note, I do prefer |
Decodes missing fields in a record as
Nothing
.Adds a helper type class
DecodeJsonField
Fixes #92