Class OpenApiValidator
java.lang.Object
org.frankframework.core.TransactionAttributes
org.frankframework.pipes.AbstractPipe
org.frankframework.pipes.FixedForwardPipe
org.frankframework.pipes.AbstractValidator
org.frankframework.pipes.OpenApiValidator
- All Implemented Interfaces:
AdapterAware, 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 an OpenAPI specification.
- Author:
- evandongen
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractValidator
AbstractValidator.ResponseValidatorWrapper -
Field Summary
Fields inherited from class AbstractPipe
parameterNamesMustBeUniqueFields inherited from class TransactionAttributes
logFields inherited from interface 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 booleanvoidSet the HTTP method to validate against.voidsetOpenApiDefinition(String openApiDefinition) The OpenAPI specification file to validate against.voidSet the path in the OpenAPI specification to validate against.voidsetReasonSessionKey(String reasonSessionKey) Stores the validation errors, if any, in the sessionKey with this value.voidsetUseAsOutputValidator(boolean useAsOutputValidator) Set this validator to be used as an output validator.protected PipeForwardvalidate(Message messageToValidate, PipeLineSession session, boolean responseMode, String messageRoot) Methods inherited from class AbstractValidator
determineForward, doPipe, doPipe, getResponseValidator, setForwardFailureToSuccess, setResponseRoot, setRoot, setSchemaSessionKey, validate, validateMethods inherited from class FixedForwardPipe
getParameterValueMethods inherited from class AbstractPipe
addForward, addParameter, createBean, findForward, getAdapter, getParameterList, getRegisteredForwards, hasRegisteredForward, isRunning, registerEvent, setApplicationContext, setChompCharSize, setDefaultValue, setDurationThreshold, setElementToMove, setElementToMoveChain, setElementToMoveSessionKey, setEmptyInputReplacement, setGetInputFromFixedValue, setGetInputFromSessionKey, setHideRegex, setIfParam, setIfValue, setLocker, setLogIntermediaryResults, setMaxThreads, setName, setOnlyIfSessionKey, setOnlyIfValue, setPreserveInput, setRemoveCompactMsgNamespaces, setRestoreMovedElements, setSecLogSessionKeys, setSizeStatistics, setSkipOnEmptyInput, setStoreResultInSessionKey, setUnlessSessionKey, setUnlessValue, setWriteToSecLog, sizeStatisticsEnabled, skipPipe, start, stop, throwEventMethods inherited from class TransactionAttributes
configureTransactionAttributes, isTransacted, isTransacted, setTransacted, setTransactionTimeoutMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AdapterAware
setAdapterMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface FrankElement
addConfigWarningMethods inherited from interface HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface HasTransactionAttribute
getTransactionAttribute, getTransactionTimeout, getTxDef, setTransactionAttributeMethods inherited from interface IForwardTarget
getNameMethods inherited from interface IPipe
addForward, findForward, getChompCharSize, getDefaultValue, getDurationThreshold, getElementToMove, getElementToMoveChain, getElementToMoveSessionKey, getGetInputFromFixedValue, getGetInputFromSessionKey, getHideRegex, getIfParam, getIfValue, getLocker, getLogIntermediaryResults, getMaxThreads, getOnlyIfSessionKey, getOnlyIfValue, getRegisteredForwards, getSecLogSessionKeys, getStoreResultInSessionKey, getUnlessSessionKey, getUnlessValue, isPreserveInput, isRemoveCompactMsgNamespaces, isRestoreMovedElements, isSkipOnEmptyInput, isWriteToSecLog, registerEvent, setChompCharSize, setDefaultValue, setDurationThreshold, setElementToMove, setElementToMoveChain, setElementToMoveSessionKey, setEmptyInputReplacement, setGetInputFromFixedValue, setGetInputFromSessionKey, setHideRegex, setIfParam, setIfValue, setLocker, setLogIntermediaryResults, setOnlyIfSessionKey, setOnlyIfValue, setPipeLine, setPreserveInput, setRemoveCompactMsgNamespaces, setRestoreMovedElements, setSecLogSessionKeys, setSkipOnEmptyInput, setStoreResultInSessionKey, setUnlessSessionKey, setUnlessValue, setWriteToSecLog, sizeStatisticsEnabled, skipPipe, start, stop, throwEvent, throwEventMethods inherited from interface IValidator
setNameMethods inherited from interface org.springframework.context.Lifecycle
isRunning
-
Constructor Details
-
OpenApiValidator
public OpenApiValidator()
-
-
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.
-
validate
protected PipeForward validate(Message messageToValidate, PipeLineSession session, boolean responseMode, String messageRoot) throws PipeRunException - Specified by:
validatein classAbstractValidator- Throws:
PipeRunException
-
setOpenApiDefinition
The OpenAPI specification file to validate against. This should be a JSON file containing the OpenAPI specification. The file should be available on the classpath. -
setPath
Set the path in the OpenAPI specification to validate against. This is used in combination with the method attribute to validate against a specific operation in the OpenAPI specification. -
setMethod
Set the HTTP method to validate against. This is used in combination with the path attribute to validate against a specific operation in the OpenAPI specification. -
setReasonSessionKey
Stores the validation errors, if any, in the sessionKey with this value. Defaults to 'failureReason'- Default value
- failureReason
-
setUseAsOutputValidator
public void setUseAsOutputValidator(boolean useAsOutputValidator) Set this validator to be used as an output validator. Please note that 'mixed' validation doesn't work well, and you need to define both an input and an output validator instance of this type with this value set to true for the output validator and false (default) for the input validator if you want to validate both input and output.- Default value
- false
-
isConfiguredForMixedValidation
protected boolean isConfiguredForMixedValidation()- Overrides:
isConfiguredForMixedValidationin classAbstractValidator
-