Support more flexible explicit defaults
Currently, explicit defaults are "all or nothing". Some users (myself included) might want to skip nulls, or skip empty collections - it would be great to have this configurable, e.g. as a Schema[_] => Boolean function rather than just Boolean.
One problem I see with this is that anything currently implemented with a SchemaVisitor won't have the original Schema[A], but rather its pieces that may be composed into a Schema again.
current thinking is having something like this
.withDefaultEncoding(
f: [A] => Field[_, A] => A => Boolean
)
then you can e.g. check if the field has an optional schema, and based on that + the value decide to e.g. write Some(defaultValue) but not None.
Okay, let's try it.
done in #1652 #1662 and released in 0.18.31.