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.
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!
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 toJson.readOrDefault
, which can be used to provide a default value if the expected value is omitted.Tests included.