Skip to content

Implement missing Arazzo spec features#77

Merged
gcatanese merged 5 commits intomainfrom
feat/missing-features
Mar 29, 2026
Merged

Implement missing Arazzo spec features#77
gcatanese merged 5 commits intomainfrom
feat/missing-features

Conversation

@gcatanese
Copy link
Copy Markdown
Member

Summary

Adds the model fields and validator logic for the Arazzo 1.0 spec features that were previously absent.

Model changes

Class Change
Info Added optional summary field
SuccessAction Added required name field
FailureAction Added required name field
Parameter value widened from String to Object (spec allows boolean, number, object, array, null)
Workflow dependsOn changed from String to List<String> (spec defines it as an array)
CriterionExpressionType New model for the { type, version } expression type object (jsonpath/xpath)
Criterion type now deserialises both plain strings and CriterionExpressionType objects via CriterionTypeDeserializer; typed accessors getType() and getExpressionType() provided

Validator changes

  • arazzo version: validated against pattern ^1\.0\.\d+(-.+)?$
  • SourceDescription.name: validated against pattern ^[A-Za-z0-9_\-]+$
  • SuccessAction.name / FailureAction.name: both checked as required fields
  • Criterion expression type: validates type is jsonpath or xpath, version is present, and context is provided
  • validateComponents: now validates successActions and failureActions (key format + content)
  • validateWorkflow: each entry in dependsOn is checked to reference an existing workflow

Tests

All new features are covered by tests (30+ new test cases added).

gcatanese and others added 5 commits March 29, 2026 13:39
Model additions:
- Info.summary optional field
- SuccessAction.name and FailureAction.name required fields
- Parameter.value widened from String to Object (spec allows boolean/number/object/array/null)
- Workflow.dependsOn changed from String to List<String> (spec defines it as an array)
- CriterionExpressionType model for jsonpath/xpath type+version objects
- Criterion.type now deserialises both plain strings and CriterionExpressionType objects via CriterionTypeDeserializer

Validator additions:
- arazzo version pattern validated against ^1\.0\.\d+(-.+)?$
- SourceDescription.name pattern validated against ^[A-Za-z0-9_\-]+$
- SuccessAction and FailureAction name field validated as required
- validateCriterion handles CriterionExpressionType (checks type is jsonpath/xpath, version is present, context is required)
- validateComponents now validates successActions and failureActions keys and contents
- validateWorkflow checks each dependsOn entry references an existing workflow

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…plication

Move shared fields name, type, workflowId, stepId, criteria and their
getters/setters/addCriteria into a common Action base class. Both
SuccessAction and FailureAction now extend it, retaining only their
own fluent builder methods and FailureAction-specific retry fields.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Extract parameter-validation loop into validateStepParameters() to
bring validateStep cognitive complexity from 17 down to 15 (S3776).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@gcatanese gcatanese merged commit d0e0437 into main Mar 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant