diff --git a/tools/postman/README.md b/tools/postman/README.md index b20f937390..69f48f213a 100644 --- a/tools/postman/README.md +++ b/tools/postman/README.md @@ -91,4 +91,4 @@ Once env vars are configured, the setup scripts can be run locally using the Mak ## Automatic updates -Postman collection is regerented automatically by github action [`release-spec.yml`](../../.github/workflows/release-spec.yml) +Postman collection is regenerated automatically by github action [`release-spec.yml`](../../.github/workflows/release-spec.yml). diff --git a/tools/postman/scripts/transform-for-api.sh b/tools/postman/scripts/transform-for-api.sh index 74e062fe31..9e922e0eda 100755 --- a/tools/postman/scripts/transform-for-api.sh +++ b/tools/postman/scripts/transform-for-api.sh @@ -59,10 +59,15 @@ jq --arg desc "$description" \ '.collection.info.description.content = $desc' \ intermediateCollectionWithName.json > intermediateCollectionWithDescription.json -echo "Adding baseUrl env $BASE_URL" +echo "Removing all variables. We use environment for variables instead" +jq \ + '.collection.variable = []' \ + intermediateCollectionWithDescription.json > intermediateCollectionWithNoVar.json + +echo "Adding baseUrl property $BASE_URL" jq --arg base_url "$BASE_URL" \ - '.collection.variable[0].value = $base_url' \ - intermediateCollectionWithDescription.json > intermediateCollectionWithBaseURL.json + '.collection.variable += [{ key: "baseUrl", value: $base_url }]' \ + intermediateCollectionWithNoVar.json > intermediateCollectionWithBaseURL.json if [ "$TOGGLE_ADD_DOCS_LINKS" = "true" ]; then echo "Adding links to docs for each request" @@ -130,6 +135,7 @@ rm intermediateCollectionWrapped.json \ intermediateCollectionWithDescription.json \ intermediateCollectionWithBaseURL.json \ intermediateCollectionWithLinks.json \ - intermediateCollectionPostBody.json + intermediateCollectionPostBody.json \ + intermediateCollectionWithNoVar.json popd -0