Skip to content

Commit 7a1fb77

Browse files
authored
CLOUDP-278958: Cleanup parameters (#305)
1 parent 63eaf67 commit 7a1fb77

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

tools/postman/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ Once env vars are configured, the setup scripts can be run locally using the Mak
9191

9292
## Automatic updates
9393

94-
Postman collection is regerented automatically by github action [`release-spec.yml`](../../.github/workflows/release-spec.yml)
94+
Postman collection is regenerated automatically by github action [`release-spec.yml`](../../.github/workflows/release-spec.yml).

tools/postman/scripts/transform-for-api.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,15 @@ jq --arg desc "$description" \
5959
'.collection.info.description.content = $desc' \
6060
intermediateCollectionWithName.json > intermediateCollectionWithDescription.json
6161

62-
echo "Adding baseUrl env $BASE_URL"
62+
echo "Removing all variables. We use environment for variables instead"
63+
jq \
64+
'.collection.variable = []' \
65+
intermediateCollectionWithDescription.json > intermediateCollectionWithNoVar.json
66+
67+
echo "Adding baseUrl property $BASE_URL"
6368
jq --arg base_url "$BASE_URL" \
64-
'.collection.variable[0].value = $base_url' \
65-
intermediateCollectionWithDescription.json > intermediateCollectionWithBaseURL.json
69+
'.collection.variable += [{ key: "baseUrl", value: $base_url }]' \
70+
intermediateCollectionWithNoVar.json > intermediateCollectionWithBaseURL.json
6671

6772
if [ "$TOGGLE_ADD_DOCS_LINKS" = "true" ]; then
6873
echo "Adding links to docs for each request"
@@ -130,6 +135,7 @@ rm intermediateCollectionWrapped.json \
130135
intermediateCollectionWithDescription.json \
131136
intermediateCollectionWithBaseURL.json \
132137
intermediateCollectionWithLinks.json \
133-
intermediateCollectionPostBody.json
138+
intermediateCollectionPostBody.json \
139+
intermediateCollectionWithNoVar.json
134140

135141
popd -0

0 commit comments

Comments
 (0)