-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add context argument to
Port
validator method
For normal `Port` instances, the `validator` signature changes from `validator(value)` to `validator(value, port)` where `port` is the instance of the `Port` to which the called validator is assigned. For `PortNamespace` validators the `port` argument is the instance of the port namespace itself. The `port` is especially useful in validators of namespaces because it can be used to see what ports are actually present. The expose functionality, which allows to exclude or include only certain ports can fundamentally change the ports that are present in a namespace, however, the validator remains untouced. To make the validator robust to these changes it should check if the port of interest is still present in the namespace before checking the corresponding value passed in the `values` argument.
- Loading branch information
Showing
4 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters