ValidateJson
Description
Validates the contents of FlowFiles against a configurable JSON Schema. See json-schema.org for specification standards. This Processor does not support input containing multiple JSON objects, such as newline-delimited JSON. If the input FlowFile contains newline-delimited JSON, only the first line will be validated.
Tags
JSON, schema, validation
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Schema Access Strategy * | Schema Access Strategy | JSON Schema Property |
| Specifies how to obtain the schema that is to be used for interpreting the data. |
Schema Name * | Schema Name | ${schema.name} | Specifies the name of the schema to lookup in the Schema Registry property Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| |
JSON Schema Registry * | JSON Schema Registry | Controller Service: JsonSchemaRegistry Implementations: StandardJsonSchemaRegistry | Specifies the Controller Service to use for the JSON Schema Registry This property is only considered if:
| |
JSON Schema * | JSON Schema | A URL or file path to the JSON schema or the actual JSON schema content This property is only considered if:
| ||
JSON Schema Version * | JSON Schema Version | Draft 2020-12 |
| The JSON schema specification This property is only considered if:
|
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
failure | FlowFiles that cannot be read as JSON are routed to this relationship |
invalid | FlowFiles that are not valid according to the specified schema are routed to this relationship |
valid | FlowFiles that are successfully validated against the schema are routed to this relationship |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
json.validation.errors | If the flow file is routed to the invalid relationship , this attribute will contain the error message resulting from the validation failure. |
State Management
This component does not store state.
Restricted
Required Permission | Explanation |
---|---|
reference remote resources | Schema configuration can reference resources over HTTP |
Input Requirement
This component requires an incoming relationship.
System Resource Considerations
Scope | Description |
---|---|
MEMORY | Validating JSON requires reading FlowFile content into memory |