Input and Output schema definition
The dataInputSchema
parameter in the Serverless Workflow specification is crucial for validating the input data of a workflow against a predefined JSON Schema. This parameter ensures that the workflow receives the correct data format before any states are executed.
Here is how you can define a dataInputSchema
:
Data Input Schema Definition
In the configuration above, the schema property specifies a URI that provides the location of the JSON schema used for validation. This URI could be a classpath URI, a file, or an HTTP URL. For classpath URIs, the JSON schema file should be placed in the project's resources section or any directory that is part of the classpath.
The failOnValidationErrors
property is an optional flag that controls the workflow's behavior when validation fails. If this flag is not specified or is set to true
, an exception will be thrown, and the workflow execution will stop. If set to false
, the workflow will proceed, but a warning log will be generated, detailing the validation errors.
Last updated