- edited description
Nicer defaults for mandatory values
Issue #16
closed
There are several values that are mandatory in the JSON schema that have reasonable default values we could use so that the caller doesn’t have to always specify them and also some places where we could map either null
or ""
to the other so that the caller doesn’t have to worry about getting this exactly right. Examples:
mediaSingle.layout
– can default toLayout.CENTER
media.collection
– can default to""
and mapnull
to itmedia.occurrenceKey
– can map""
tonull
mediaInline
– same fix-ups asmedia
mention.id
– schema permits""
, which is currently disallowedmention.text
– must start with@
, but if""
we can map tonull
and otherwise we can just silently add@
ourselves
This will be a binary compatibility break because it involves dropping the partial builder stats for things like Media.Partial.NeedsCollection
, since these can now build without a collection. This is worth it because
- It isn’t a source compatibility break (unless folks are explicitly declaring a variable to hold the intermediate type).
- Most callers will no longer want to call the method at all, whereas previously they had to even to provide the default.
Additionally, the exception for mention.text
not starting with @
is no longer needed, so it is removed, though there aren’t very many reasons why anyone would catch that anyway.
Comments (3)
-
reporter -
reporter - changed status to resolved
Fixed in
0.17.0
-
reporter - changed status to closed
- Log in to comment