Closed clone1612 closed 3 months ago
Yes, I think this type of check may be worth supporting / standardizing. This study states it as the most common type of cross-parameter validation.
But the standardization process of these cross-parameter input validation issues has not been going smoothly as it is. I'm therefore a bit hesitant on adding yet another issue type to the proposal.
Perhaps we can implement it without introducing a new issue type, and reuse the existing urn:problem-type:belgif:input-validation:requiredInput = Input is required in this context. With a detail message that expresses the relation between both parameters, and referencing both parameters in the (also not standardized) inputs[] array.
@pvdbosch what do you think?
Consider an API with query parameters sector & institution that have the following relation:
The current methods from
RequestValidator
cannot express this, the closest we have iswhen(boolean condition, Consumer<RequestValidator> requestValidatorConsumer)
but that doesn't result in a response which expresses the relation.I believe adding a method for this scenario would be useful, although I don't have an immediate idea for its name. Maybe
requireDependency
?