Graph Validation
Last updated
Last updated
Rendered.ai provides a way for channel developers to add validation rules to the inputs of their nodes. These rules are checked while Users are modifying the Graph and can alert users that an input is invalid in some way. It is important to note that Graph validation will not block a user from submitting a bad graph for preview, staging the graph to run a job or downloading the graph.
Below we’ll explore how these Graph validation errors are displayed to Users.
Values entered into an input can be checked for the correct type or a set of rules. If a value is entered that is not the correct type then the field is highlighted in red and an error icon is displayed to the right of the value. If you hover over this icon you will see an error message indicating what is wrong.
In the following example, the “Image Width (px)” input is defined to be an integer data type. Entering a text value results in an error. Hovering over the error icon displays the “Value must be type ‘integer'“ error message.
Bad values can also be values that fall outside of a valid range. In the example below, the value is the correct type (integer) but it falls outside of the possible bounds for the value and the error icon displays the “Value must be less than or equal to 1“ error message.
The number of links connected to an input can be checked. Inputs can be defined to have zero or more links, one link, one or more, etc. If a link validation error occurs then the input will be highlighted in red and an error icon will be displayed in the upper right of the field. Hovering over the icon will display the error message.
In the following example, the “Sensor” input requires exactly one link. Attaching a second link to the input generates an error. Hovering over the error icon displays the “Input requires exactly one link” error message.