Skip to content

Commit 66b16f3

Browse files
authored
refactor(stepfunctions): deprecate unused DISCARD variable and include JsonPath.DISCARD in docs (#26770)
The `DISCARD` variable is removed because it unused. The docs are updated to be more clear to use `JsonPath.DISCARD` for `CatchProps` and `ChoiceProps`. Closes #26760 . ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 8c9f0e2 commit 66b16f3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

packages/aws-cdk-lib/aws-stepfunctions/lib/states/choice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface ChoiceProps {
1919
/**
2020
* JSONPath expression to select part of the state to be the input to this state.
2121
*
22-
* May also be the special value DISCARD, which will cause the effective
22+
* May also be the special value JsonPath.DISCARD, which will cause the effective
2323
* input to be the empty object {}.
2424
*
2525
* @default $
@@ -29,7 +29,7 @@ export interface ChoiceProps {
2929
/**
3030
* JSONPath expression to select part of the state to be the output to this state.
3131
*
32-
* May also be the special value DISCARD, which will cause the effective
32+
* May also be the special value JsonPath.DISCARD, which will cause the effective
3333
* output to be the empty object {}.
3434
*
3535
* @default $

packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ export function renderList<T>(xs: T[], mapFn: (x: T) => any, sortFn?: (a: T, b:
574574
}
575575

576576
/**
577-
* Render JSON path, respecting the special value DISCARD
577+
* Render JSON path, respecting the special value JsonPath.DISCARD
578578
*/
579579
export function renderJsonPath(jsonPath?: string): undefined | null | string {
580580
if (jsonPath === undefined) { return undefined; }

packages/aws-cdk-lib/aws-stepfunctions/lib/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export interface CatchProps {
146146
/**
147147
* JSONPath expression to indicate where to inject the error data
148148
*
149-
* May also be the special value DISCARD, which will cause the error
149+
* May also be the special value JsonPath.DISCARD, which will cause the error
150150
* data to be discarded.
151151
*
152152
* @default $
@@ -156,5 +156,6 @@ export interface CatchProps {
156156

157157
/**
158158
* Special string value to discard state input, output or result
159+
* @deprecated use JsonPath.DISCARD
159160
*/
160-
export const DISCARD = 'DISCARD';
161+
export const DISCARD = 'DISCARD';

0 commit comments

Comments
 (0)