Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upJson.Decode.decodeString never succeeds when input is empty string #585
Comments
jinjor
changed the title from
Json.Decode never succeeds when input is empty string
to
Json.Decode.decodeString never succeeds when input is empty string
May 2, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
May 18, 2016
Contributor
It was noted on the mailing list that this is not a bug, but instead the expected behavior, since the emtpy string is not valid JSON.
|
It was noted on the mailing list that this is not a bug, but instead the expected behavior, since the emtpy string is not valid JSON. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jinjor
May 19, 2016
Contributor
Ah, now I understand. Thank you.
The real problem here was "I assumed Json.Decode.succeed always succeeds even if given JSON is invalid", but it was wrong.
|
Ah, now I understand. Thank you. |
jinjor
closed this
May 19, 2016
jvoigtlaender
referenced this issue
May 19, 2016
Closed
Note (in docu) that Json.Decode.succeed may fail? #613
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
May 19, 2016
Contributor
I think the documentation could be more helpful, to prevent such misunderstandings. I opened https://github.com/elm-lang/core/issues/613.
|
I think the documentation could be more helpful, to prevent such misunderstandings. I opened https://github.com/elm-lang/core/issues/613. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Seems good :) |
jinjor commentedMay 2, 2016
•
edited
Edited 1 time
-
jinjor
edited May 2, 2016 (most recent)
For SSCCE:
This shows:
I ran into this problem when I used Http.post and tried to decode response (which is empty string). This issue may be related to this issue.