You can use the Validate Model Node to validate a model of your choosing. The model can be predefined, or created just for the Node.
You can configure the Node to either output on an output when validation fails, or throw an error.
Data refers the object that will be validated against the chosen
Consider the following Workflow:
We have our Validate Model Node configured like in the first picture. Our API Request Node is configured for endpoint
person with a
post method. We intend on validating the data coming into the API against the following model.
Our model indicates that the
lastName properties are required. In addition, we've set display names for each property to give the consumer a user friendly error message, as our hypothetical API will be consumed via a web app.
Using Postman to test our API yields the following results:
Learn more about Models: