From 993942238046ffb5f9912929e97ef4f0450726f3 Mon Sep 17 00:00:00 2001 From: markford Date: Fri, 24 Jun 2022 11:25:24 -0400 Subject: [PATCH] address PR comments: better comment in asl source and error formatting. --- src/__tests__/definitions/invalid-map-ob-link.json | 2 +- src/__tests__/definitions/invalid-parallel-ob-link.json | 2 +- src/validator.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/__tests__/definitions/invalid-map-ob-link.json b/src/__tests__/definitions/invalid-map-ob-link.json index 39c50fc..0f35049 100644 --- a/src/__tests__/definitions/invalid-map-ob-link.json +++ b/src/__tests__/definitions/invalid-map-ob-link.json @@ -1,5 +1,5 @@ { - "Comment": "An example of the Amazon States Language using a map state to map over items in parallel.", + "Comment": "The link to \"Final State\" from within the Iterator is invalid since the target state is defined outside of the Iterator", "StartAt": "Map", "States": { "Map": { diff --git a/src/__tests__/definitions/invalid-parallel-ob-link.json b/src/__tests__/definitions/invalid-parallel-ob-link.json index 038d8ff..5d40645 100644 --- a/src/__tests__/definitions/invalid-parallel-ob-link.json +++ b/src/__tests__/definitions/invalid-parallel-ob-link.json @@ -1,5 +1,5 @@ { - "Comment": "An example of the Amazon States Language using a parallel state to execute two branches at the same time.", + "Comment": "The link to the \"Final State\" within the Choice is invalid because it targets a state outside of its parent branch", "StartAt": "Parallel", "States": { "Parallel": { diff --git a/src/validator.js b/src/validator.js index b1d6c3d..0f8c956 100644 --- a/src/validator.js +++ b/src/validator.js @@ -62,7 +62,7 @@ function validator(definition) { errorList.push(ajv.errorsText(ajv.errors, { separator })); } errorList.push(missingTransitionTargetErrors.map(formatError).join(separator)); - errorList.push(transitionErrors.join(separator)); + errorList.push(transitionErrors.map(formatError).join(separator)); return errorList.join(separator); }, };