Skip to content

Activity: validate input against InputSchema #58

@paullatzelsperger

Description

@paullatzelsperger

An ActivityDefinition has the InputSchema property, which is supposed to contain the JSON schema for any input values. The input values are transmitted in Activity.Inputs.

Additionally, each ActivityDefinition declares an OutputSchema, which specifies the format of the activity's output data.

We should validate both those schemas in the following ways:

  • Validate input data (Activity.Inputs) against the corresponding ActivityDefinition.InputSchema. This should be done when instantiating the activity, i.e. when creating the OrchestrationDefinition
  • When instantiating activities (again, during ingesting the OrchestrationDefinition via API) we should check each activity's outputs against the inputs of its dependents. If AcitivtyB dependsOn ActivityA, then B's inputs must be validated against A's outputs. This is only relevant for activities that have a dependsOn relationship. If a schema validation is detected, the API request should return an HTTP 400.
    If this proves to be impractical, the check could also be done when instantiating Orchestrations.
  • [Optional] Validating inputs at runtime: when an activity is started, validation could be done against its input values. This is done "sort-of" by unmarshalling JSON objects, but true schema validation would go beyond that.

Metadata

Metadata

Labels

apianything to do with REST APIsenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions