Fix Arazzo spec inconsistencies in validator and model#76
Merged
Conversation
- 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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Fixes six inconsistencies between the implementation and the Arazzo 1.0 specification.
Changes
Validator fixes
invalues: removed"body"from the accepted list; the spec only allowspath,query,header,cookieworkflowId/stepIdare now only required whentypeisgoto;endtype requires neitherworkflowId/stepIdare only required forgototype, not forendorretryworkflowIdtoworkflowExists()instead ofsuccessAction.getWorkflowId()workflowIdRegularExpression(): fixed broken regex[A-Za-z0-9_\\\\-]++(double-escaped backslash, possessive quantifier) to[A-Za-z0-9_\\-]+Model fixes
FailureAction.retryAfter: changed fromLongtoDouble— the spec defines it as a non-negative decimal numberRequestBody: renamedpayoadReplacement(typo) field toreplacementstyped asList<PayloadReplacement>; the spec definesreplacementsas an arrayPayloadReplacement: new class replacing the misnamedPayoadReplacementTests
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,bodyas invalidinvalue, workflowId existence check).