Closed FranklinChen closed 9 years ago
Yes, there is still room for improvement. I will hopefully fix this one soon.
It would help to have this file as an attachment though. When I tried to copy it from the web page I got a message about invalid JSON.
GitHub doesn't allow non-image attachments, so here is a link to events.json
to elsewhere: http://pastebin.com/raw.php?i=QmSGi0wG
I took a quick look at what happened. Basically, given an array of objects, the inference of the possible type of an object is not taking into account optional fields, e.g., description
should have come out as a Maybe Text
.
I see that progress has been made on this, thanks! One thing missing is that the FromJSON
instance is being generated incorrectly, e.g., if a field "fee" is optional, we need
v .:? "fee"
instead of
v .: "fee"
I also spotted this problem and will probably fix it over Easter. As I aim for a stable version in a month, I setup automatic test generation for this and many other problems. Best Michal
On Thursday, April 2, 2015, Franklin Chen notifications@github.com wrote:
I see that progress has been made on this, thanks! One thing missing is that the FromJSON instance is being generated incorrectly, e.g., if a field "fee" is optional, we need
v .:? "fee"
instead of
v .: "fee"
— Reply to this email directly or view it on GitHub https://github.com/mgajda/json-autotype/issues/3#issuecomment-88682899.
Pozdrawiam Michał
I've just uploaded version 0.2.5.13, which seems to fix the issue in {{events.json}}.
I ran on the following file but got an error.