Commit b51bdaa
authored
fix: custom api does not work when step parameter is the JSON body itself (#1281)
## Problem
Custom API body does not work when the step parameter is the body.
The computed variable from the step parameter is not being parsed
properly.
## Solution
* Attempt to parse the variable as a valid JSON first
* Only strip the extra " from the start and end of the string if its not
a valid JSON as the user would have already wrapped it in "
## How to test?
- [ ] Works when body is a manually configured JSON, i.e., variables are
used as the key or value in the JSON object
- [ ] Works when the body is a JSON object from a step variable1 parent 2849ea7 commit b51bdaa
File tree
1 file changed
+13
-0
lines changed- packages/backend/src/apps/custom-api/actions/http-request
1 file changed
+13
-0
lines changedLines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
94 | 105 | | |
95 | 106 | | |
| 107 | + | |
| 108 | + | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
| |||
0 commit comments