Provide an option for a field to be hidden from the documentation while still being validated #747
Labels
status: waiting-for-votes
Requires more interest from the community
type: enhancement
Enhancement that adds a new feature
Hi,
Let's say we have a field description like this:
If the returned value is
"foo": null
, then an exception is being thrown because null is not considered a STRING.In such cases, we can mark the field as
.optional()
, signalling that a String may be provided, but can also be null.The problem I noticed is that
.ignored()
also gets rid of this exception. IMHO that shouldn't happen, because the returned value (null) still violates the field description. In other words: the value is still optional, and hiding it from the docs does not change that fact.In short, for a nullable field "foo", which should not be included in the docs, I'd expect this syntax:
Of course all of the above is a matter of how we interpret what it means for a description to be ignored.
If the above is expected behavior, maybe it would make sense to split "hiding from docs" and "ignoring type" into separate fields, so we can do this
fieldWithPath("foo").hide().optional()
(hide, but still validate) ?The text was updated successfully, but these errors were encountered: