Skip to content
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

Fixed merge conflicts, filter out empty values #1

Closed

Conversation

AndreiVidrasco
Copy link

JSON Output with initial implementation included all default values, like empty dictionaries or empty arrays. Because of that output json was quite big. If we filter out those resulting json becomes much smaller, in my case it was 90% size reduction.

@ryohey ryohey force-pushed the projectspec-json branch from d5645ea to ea6fb60 Compare April 20, 2019 03:24
@ryohey
Copy link
Owner

ryohey commented Apr 20, 2019

@AndreiVidrasco Thank you for your pull-request! We decide to do not remove empty dictionaries or empty arrays in toJSONValue() because it is useful in some situation and to remove complexity. It is discussed at yonaskolb#545 (comment).

All these if array.count > 0 { are not really required. It might be useful for some use cases to generate out all the empty arrays. For the compact spec you have now, there could be a function JSONDictionary.removeEmptyArrays that loops through and removes all empty arrays
yonaskolb#545 (comment)

Definitely your suggested feature is needed to generate human readable JSON. I considering it to filtering empty values within whole JSON recursively after ProjectSpec.toJSONDictionary() instead of processing in each toJSONValue().
I suggest that you make a pull-request that adding the feature that filters our empty values to yonaskolb's repository after yonaskolb#545 is merged.

@AndreiVidrasco
Copy link
Author

Ok, thanks. I will follow your pull request to and submit a new one to yonaskolb later

ryohey pushed a commit that referenced this pull request Oct 8, 2019
Add support for explicit includes on sources.
ryohey pushed a commit that referenced this pull request Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants