-
Notifications
You must be signed in to change notification settings - Fork 211
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
Empty alternative does not trigger JSON name preservation #1201
Comments
Thanks for the testcase! That expected output looks very reasonable. We should also handle empty alternatives with the
I'd propose generating I'll submit a PR soon. |
Actually that should probably be @Gabriel439 Thoughts? |
@sjakobi: Yeah, |
Possibly related to #1080, #1145
As per the
dhall-json
testsnesting{0,1}
, the use of a record with fieldsfield
,nesting
, andcontents
is supposed to preserve the name of the union alternative alongside the value, either Inline or Nested. However the behaviour does not trigger when the union alternative is empty.For example, with this input:
I expect this output:
But instead get:
I have added a test case for this in my fork but I'm not familiar enough with Haskell to implement a fix: master...wezm:json-nesting-empty-alternative
The text was updated successfully, but these errors were encountered: