Json Validator
AI-generatedOverview
This node validates input data against a user-defined JSON Schema using the AJV (Another JSON Schema Validator) library. It is useful for ensuring that JSON data conforms to specific structural and content rules before further processing. For example, it can be used to validate API request payloads, configuration files, or any JSON data to enforce data integrity and correctness.
Use Case Examples
- Validating incoming webhook JSON payloads to ensure required fields and types are present.
- Checking configuration JSON files against a schema to prevent errors in downstream processes.
Properties
| Name | Meaning |
|---|---|
| JSON Schema | The JSON Schema (draft-07) used to validate the input data. It defines the expected structure, types, required fields, and other validation rules for the JSON data. |
Output
JSON
valid- Boolean indicating if the input data is valid according to the JSON Schema.errors- Array of validation error objects detailing why the input data did not conform to the schema, if any.
Dependencies
- AJV library for JSON Schema validation
Troubleshooting
- Ensure the JSON Schema provided is a valid draft-07 schema; invalid schemas will cause validation errors.
- If validation fails, check the 'errors' output to understand which parts of the data do not conform to the schema.
- Make sure the input data to be validated is in proper JSON format.
Links
- JSON Schema Draft-07 - Official specification for JSON Schema draft-07 used to define validation rules.
- AJV Errors - Documentation on AJV's error handling and custom error messages used by this node.