Skip to content

Commit f0e134e

Browse files
committed
fix(designer): Removed new OpenAPI token behavior added in #4122 (#4158)
Revert new behavior added in #4122
1 parent 6f80a64 commit f0e134e

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

libs/designer/src/lib/core/utils/parameters/__test__/helper.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,16 +2305,6 @@ describe('core/utils/parameters/helper', () => {
23052305
['outputs.$.headers', undefined, `triggerOutputs()`],
23062306
['outputs.$.relativePathParameters', undefined, `triggerOutputs()`],
23072307

2308-
// For nested properties (OpenAPI) within `outputs.$.body`, use BODY.
2309-
['outputs.$.body.ID', undefined, `triggerBody()`],
2310-
['outputs.$.body.Title', undefined, `triggerBody()`],
2311-
['outputs.$.body.Author.DisplayName', undefined, `triggerBody()`],
2312-
2313-
// For nested path properties (OpenAPI) within `outputs.$.body/*`, use BODY.
2314-
['outputs.$.body/value.ID', undefined, `triggerBody()`],
2315-
['outputs.$.body/value.Title', undefined, `triggerBody()`],
2316-
['outputs.$.body/value.Author.DisplayName', undefined, `triggerBody()`],
2317-
23182308
// For values using `body/*` syntax, use OUTPUTS.
23192309
['outputs.$.body/subject', 'Get_event_(V3)', `outputs('Get_event_(V3)')`],
23202310
])('correctly gets the token expression for %p', (key, actionName, expected) => {

libs/designer/src/lib/core/utils/parameters/helper.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,17 +1022,7 @@ function segmentsAreBodyReference(segments: Segment[]): boolean {
10221022
return false;
10231023
}
10241024

1025-
if (segments[0].value === OutputSource.Body) {
1026-
return true;
1027-
}
1028-
1029-
// For tokens of format `outputs.$.body.Title` or `outputs.$.body/Title`, where we are referring to a property within
1030-
// the body, we have to reference the body rather than the outputs field.
1031-
return (
1032-
segments.length >= 4 &&
1033-
isString(segments[2].value) &&
1034-
(segments[2].value === constants.OUTPUT_LOCATIONS.BODY || segments[2].value.startsWith(`${constants.OUTPUT_LOCATIONS.BODY}/`))
1035-
);
1025+
return segments[0].value === OutputSource.Body;
10361026
}
10371027

10381028
// NOTE: For example, if tokenKey is outputs.$.foo.[*].bar, which means

0 commit comments

Comments
 (0)