Skip to content

Fix Arazzo spec inconsistencies in validator and model#76

Merged
gcatanese merged 2 commits intomainfrom
fix/arazzo-spec-inconsistencies
Mar 29, 2026
Merged

Fix Arazzo spec inconsistencies in validator and model#76
gcatanese merged 2 commits intomainfrom
fix/arazzo-spec-inconsistencies

Conversation

@gcatanese
Copy link
Copy Markdown
Member

Summary

Fixes six inconsistencies between the implementation and the Arazzo 1.0 specification.

Changes

Validator fixes

  • Parameter in values: removed "body" from the accepted list; the spec only allows path, query, header, cookie
  • SuccessAction validation: workflowId/stepId are now only required when type is goto; end type requires neither
  • FailureAction validation: same fix — workflowId/stepId are only required for goto type, not for end or retry
  • SuccessAction workflowId existence check: was passing the parent workflowId to workflowExists() instead of successAction.getWorkflowId()
  • workflowIdRegularExpression(): fixed broken regex [A-Za-z0-9_\\\\-]++ (double-escaped backslash, possessive quantifier) to [A-Za-z0-9_\\-]+

Model fixes

  • FailureAction.retryAfter: changed from Long to Double — the spec defines it as a non-negative decimal number
  • RequestBody: renamed payoadReplacement (typo) field to replacements typed as List<PayloadReplacement>; the spec defines replacements as an array
  • PayloadReplacement: new class replacing the misnamed PayoadReplacement

Tests

Updated existing tests that relied on the incorrect behaviour and added new targeted tests for each fix (goto-only constraints, decimal retryAfter, hyphenated workflow IDs, body as invalid in value, workflowId existence check).

gcatanese and others added 2 commits March 29, 2026 13:15
- Remove 'body' from valid parameter 'in' values (spec: path/query/header/cookie only)
- Fix SuccessAction/FailureAction validation: workflowId or stepId is only required when type is 'goto', not for 'end' or 'retry'
- Fix validateSuccessAction workflowId existence check used the parent workflowId instead of successAction.getWorkflowId()
- Fix workflowIdRegularExpression broken regex (escaped backslash and possessive quantifier)
- Change FailureAction.retryAfter from Long to Double (spec defines it as a non-negative decimal number)
- Rename PayoadReplacement to PayloadReplacement and change RequestBody.replacements to List<PayloadReplacement>
- Update and expand tests to cover all fixed behaviours

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- Extract validateGotoTarget() private helper in OpenAPIWorkflowValidator to eliminate the duplicated 'must define either' and 'cannot define both' goto checks shared between validateSuccessAction and validateFailureAction
- Add validatorWithStepIds() and validatorWithWorkflowIds() private helpers in the test class to replace repeated Map/Set setup boilerplate across eight tests

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

Quality Gate Failed Quality Gate failed

Failed conditions
9.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@gcatanese gcatanese merged commit b4be1fe into main Mar 29, 2026
2 of 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