@SideEffectFree @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"JSON","schema","validation"}) @WritesAttributes(value=@WritesAttribute(attribute="json.validation.errors",description="If the flow file is routed to the invalid relationship , this attribute will contain the error message resulting from the validation failure.")) @CapabilityDescription(value="Validates the contents of FlowFiles against a configurable JSON Schema. See json-schema.org for specification standards.") @SystemResourceConsideration(resource=MEMORY, description="Validating JSON requires reading FlowFile content into memory") @Restricted(restrictions=@Restriction(requiredPermission=REFERENCE_REMOTE_RESOURCES,explanation="Schema configuration can reference resources over HTTP")) public class ValidateJson extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
static class |
ValidateJson.SchemaVersion |
| Modifier and Type | Field and Description |
|---|---|
static String |
ERROR_ATTRIBUTE_KEY |
private static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
static List<PropertyDescriptor> |
PROPERTIES |
static Relationship |
REL_FAILURE |
static Relationship |
REL_INVALID |
static Relationship |
REL_VALID |
static Set<Relationship> |
RELATIONSHIPS |
private com.networknt.schema.JsonSchema |
schema |
static PropertyDescriptor |
SCHEMA_CONTENT |
static PropertyDescriptor |
SCHEMA_VERSION |
| Constructor and Description |
|---|
ValidateJson() |
| Modifier and Type | Method and Description |
|---|---|
Set<Relationship> |
getRelationships() |
List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final String ERROR_ATTRIBUTE_KEY
public static final PropertyDescriptor SCHEMA_CONTENT
public static final PropertyDescriptor SCHEMA_VERSION
public static final List<PropertyDescriptor> PROPERTIES
public static final Relationship REL_VALID
public static final Relationship REL_INVALID
public static final Relationship REL_FAILURE
public static final Set<Relationship> RELATIONSHIPS
private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
private com.networknt.schema.JsonSchema schema
public Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorpublic final List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponent@OnScheduled public void onScheduled(ProcessContext context) throws IOException
IOExceptionpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.