Skip to content

Commit

Permalink
refactor(stepfunctions): deprecate unused DISCARD variable and includ…
Browse files Browse the repository at this point in the history
…e 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*
  • Loading branch information
kirkwat authored Aug 17, 2023
1 parent 8c9f0e2 commit 66b16f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-stepfunctions/lib/states/choice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ChoiceProps {
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value DISCARD, which will cause the effective
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* @default $
Expand All @@ -29,7 +29,7 @@ export interface ChoiceProps {
/**
* JSONPath expression to select part of the state to be the output to this state.
*
* May also be the special value DISCARD, which will cause the effective
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* @default $
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export function renderList<T>(xs: T[], mapFn: (x: T) => any, sortFn?: (a: T, b:
}

/**
* Render JSON path, respecting the special value DISCARD
* Render JSON path, respecting the special value JsonPath.DISCARD
*/
export function renderJsonPath(jsonPath?: string): undefined | null | string {
if (jsonPath === undefined) { return undefined; }
Expand Down
5 changes: 3 additions & 2 deletions packages/aws-cdk-lib/aws-stepfunctions/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export interface CatchProps {
/**
* JSONPath expression to indicate where to inject the error data
*
* May also be the special value DISCARD, which will cause the error
* May also be the special value JsonPath.DISCARD, which will cause the error
* data to be discarded.
*
* @default $
Expand All @@ -156,5 +156,6 @@ export interface CatchProps {

/**
* Special string value to discard state input, output or result
* @deprecated use JsonPath.DISCARD
*/
export const DISCARD = 'DISCARD';
export const DISCARD = 'DISCARD';

0 comments on commit 66b16f3

Please sign in to comment.