Skip to content

Commit bd31efb

Browse files
authored
Release v1.55.1 (#1299)
- fix: custom api does not work when step parameter is the JSON body
2 parents 68b7e13 + 45f0e7e commit bd31efb

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@
111111
"tsconfig-paths": "^4.2.0",
112112
"type-fest": "4.10.3"
113113
},
114-
"version": "1.55.0"
114+
"version": "1.55.1"
115115
}

packages/backend/src/apps/custom-api/actions/http-request/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,21 @@ const action: IRawAction = {
9191

9292
preprocessVariable(parameterKey: string, variableValue: unknown) {
9393
if (parameterKey === 'data' && typeof variableValue === 'string') {
94+
// check if the variable is a valid JSON
95+
if (variableValue.startsWith('{') || variableValue.endsWith('}')) {
96+
try {
97+
JSON.parse(variableValue as string)
98+
// its a valid JSON, don't need to do anything extra
99+
return variableValue
100+
} catch (e) {
101+
// not a valid JSON, remove the " from the start and end of the string
102+
return JSON.stringify(variableValue).slice(1, -1)
103+
}
104+
}
94105
// NOTE: this removes the " from the start and end of the string
95106
// as it is already added in the user input
107+
// when user forms the JSON on the frontend:
108+
// {"key": "<variable>"}
96109
return JSON.stringify(variableValue).slice(1, -1)
97110
}
98111
return variableValue

packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frontend",
3-
"version": "1.55.0",
3+
"version": "1.55.1",
44
"type": "module",
55
"scripts": {
66
"dev": "wait-on tcp:3000 && vite --host --force",

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"name": "@plumber/types",
33
"description": "Shared types for plumber",
44
"types": "./index.d.ts",
5-
"version": "1.55.0"
5+
"version": "1.55.1"
66
}

0 commit comments

Comments
 (0)