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

Add writeUnlessDefault function #42

Merged

Conversation

neoeinstein
Copy link
Member

There are times, especially with option types, where it is nice to be able to omit default values (that would otherwise be output as null). Json.writeUnlessDefault provides a nice complimentary function to Json.readOrDefault, which can be used to provide a default value if the expected value is omitted.

Tests included.

@kolektiv
Copy link
Member

kolektiv commented Oct 6, 2015

Ah yeah I think I see how this fits and makes sense. Cool, ok, I'll merge this in to dev, sort some internal tweaks out and push a new release out shortly. Thanks!

kolektiv added a commit that referenced this pull request Oct 6, 2015
…ult-values

Add writeUnlessDefault function
@kolektiv kolektiv merged commit 8567e44 into xyncro:develop Oct 6, 2015
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.

None yet

2 participants