Package org.frankframework.pipes
Class JsonValidator
java.lang.Object
org.frankframework.core.TransactionAttributes
org.frankframework.pipes.AbstractPipe
org.frankframework.pipes.FixedForwardPipe
org.frankframework.pipes.AbstractValidator
org.frankframework.pipes.JsonValidator
- All Implemented Interfaces:
FrankElement,HasApplicationContext,HasName,HasTransactionAttribute,IConfigurable,IDualModeValidator,IForwardTarget,IPipe,IScopeProvider,IValidator,IWithParameters,NameAware,EventThrowing,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle
Pipe that validates the input message against a JSON Schema.
- Author:
- Gerrit van Brakel
-
Nested Class Summary
Nested classes/interfaces inherited from class org.frankframework.pipes.AbstractValidator
AbstractValidator.ResponseValidatorWrapper -
Field Summary
Fields inherited from class org.frankframework.pipes.AbstractPipe
parameterNamesMustBeUniqueFields inherited from class org.frankframework.core.TransactionAttributes
logFields inherited from interface org.frankframework.core.IPipe
LONG_DURATION_MONITORING_EVENT, MESSAGE_SIZE_MONITORING_EVENT, PIPE_EXCEPTION_MONITORING_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks for correct configuration of forward.protected com.networknt.schema.JsonSchemavoidsetReasonSessionKey(String reasonSessionKey) If set: creates a sessionKey to store any errors when validating the json outputvoidThe JSON Schema to validate tovoidsetSubSchemaPrefix(String prefix) The subSchemaPrefix is an optional attribute used when referencing a subschema located in a nested structure, such as $defs or definitions.voidstart()Perform necessary action to start the pipe.protected PipeForwardvalidate(Message messageToValidate, PipeLineSession session, boolean responseMode, String messageRoot) Methods inherited from class org.frankframework.pipes.AbstractValidator
determineForward, doPipe, doPipe, getResponseValidator, isConfiguredForMixedValidation, setForwardFailureToSuccess, setResponseRoot, setRoot, setSchemaSessionKey, validate, validateMethods inherited from class org.frankframework.pipes.FixedForwardPipe
getParameterValue, setIfParam, setIfValue, setOnlyIfSessionKey, setOnlyIfValue, setSkipOnEmptyInput, setUnlessSessionKey, setUnlessValue, skipPipeMethods inherited from class org.frankframework.pipes.AbstractPipe
addForward, addParameter, consumesSessionVariable, createBean, findForward, getAdapter, getEventSourceName, getForwards, getParameterList, hasRegisteredForward, isRunning, registerEvent, setApplicationContext, setChompCharSize, setDurationThreshold, setElementToMove, setElementToMoveChain, setElementToMoveSessionKey, setEmptyInputReplacement, setGetInputFromFixedValue, setGetInputFromSessionKey, setHideRegex, setLocker, setLogIntermediaryResults, setMaxThreads, setName, setPreserveInput, setRemoveCompactMsgNamespaces, setRestoreMovedElements, setSecLogSessionKeys, setSizeStatistics, setStoreResultInSessionKey, setWriteToSecLog, sizeStatisticsEnabled, stop, throwEventMethods inherited from class org.frankframework.core.TransactionAttributes
configureTransactionAttributes, isTransacted, isTransacted, setTransacted, setTransactionTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.core.HasTransactionAttribute
getTransactionAttribute, getTransactionTimeout, getTxDef, setTransactionAttributeMethods inherited from interface org.frankframework.core.IForwardTarget
getNameMethods inherited from interface org.frankframework.core.IPipe
addForward, consumesSessionVariable, getChompCharSize, getDurationThreshold, getElementToMove, getElementToMoveChain, getElementToMoveSessionKey, getEmptyInputReplacement, getForwards, getGetInputFromFixedValue, getGetInputFromSessionKey, getHideRegex, getLocker, getLogIntermediaryResults, getMaxThreads, getSecLogSessionKeys, getStoreResultInSessionKey, isPreserveInput, isRemoveCompactMsgNamespaces, isRestoreMovedElements, isWriteToSecLog, registerEvent, setChompCharSize, setDurationThreshold, setElementToMove, setElementToMoveChain, setElementToMoveSessionKey, setEmptyInputReplacement, setGetInputFromFixedValue, setGetInputFromSessionKey, setHideRegex, setLocker, setLogIntermediaryResults, setPipeLine, setPreserveInput, setRemoveCompactMsgNamespaces, setRestoreMovedElements, setSecLogSessionKeys, setStoreResultInSessionKey, setWriteToSecLog, sizeStatisticsEnabled, stop, throwEvent, throwEventMethods inherited from interface org.frankframework.core.IValidator
setNameMethods inherited from interface org.springframework.context.Lifecycle
isRunning
-
Constructor Details
-
JsonValidator
public JsonValidator()
-
-
Method Details
-
configure
Description copied from class:FixedForwardPipeChecks for correct configuration of forward.- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classAbstractValidator- Throws:
ConfigurationException- in case it was not able to configure the component.
-
start
public void start()Description copied from interface:IPipePerform necessary action to start the pipe. This method is executed after theIConfigurable.configure()method, for each start and stop command of the adapter.- Specified by:
startin interfaceIPipe- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Overrides:
startin classAbstractPipe
-
validate
protected PipeForward validate(Message messageToValidate, PipeLineSession session, boolean responseMode, String messageRoot) throws PipeRunException - Specified by:
validatein classAbstractValidator- Throws:
PipeRunException
-
getJsonSchema
- Throws:
IOException
-
setSchema
The JSON Schema to validate to -
setSubSchemaPrefix
The subSchemaPrefix is an optional attribute used when referencing a subschema located in a nested structure, such as $defs or definitions. Adding only the subSchema attribute is not enough if your schema organizes definitions in nested objects. Add root attribute to complete the process.- Default value
- /definitions/
-
setReasonSessionKey
If set: creates a sessionKey to store any errors when validating the json output- Default value
- failureReason
-