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
Breaking changes on 0.10 regarding Null field parsing on Maybe types #287
Comments
You use a wrong operator. Field val has type |
@lykahb I see, so previously
In newtype A = A { val :: Maybe String } deriving Show
λ: instance FromJSON A where parseJSON (Object o) = A <$> o .: "val"
λ: eitherDecode "{ \"val\" : null }" :: Either String A
Right (A {val = Nothing}) |
Here's a list of the old and new differences. http://lpaste.net/141286 |
This is a major breaking change; I'd echo @gregwebs request that this be in the changelog or maybe use a different operator. |
Hi, My Original proposal was:
This gives you some very nice properties: eg. the |
@lykahb, this also seems to work in 0.10:
Is this a valid option to get old behavior or do I need to use |
@sapek Yes, they should have the same behavior. |
I would +1 pull #288 - is anything happening with this thread? |
This is sorted by: #326 |
thanx for info! Pull request #326 does not seem to be merged into master yet - any idea when this might be released? |
I use |
@bos bump |
I believe this should now be fixed. |
No longer necessary after haskell/aeson#287 has been fixed.
Is this intended behavior? Normally
Maybe
types would returnNothing
in the presence of aNull
field (Under 0.9).This change causes the
stripe-haskell
project to fail 95% of tests. 😭The text was updated successfully, but these errors were encountered: