Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions tools/postman/scripts/transform-for-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,21 @@ else
cp intermediateCollectionPostBody.json "$COLLECTION_TRANSFORMED_FILE_NAME"
fi

# Remove trailing whitespaces by reformatting the JSON
echo "Removing all whitespaces from the final JSON file"
jq -c '.' "$COLLECTION_TRANSFORMED_FILE_NAME" > tmpnowhitespaces.json && mv tmpnowhitespaces.json "$COLLECTION_TRANSFORMED_FILE_NAME"

# Clean up temporary files
echo "Removing temporary files"
rm intermediateCollectionWrapped.json \
intermediateCollectionDisableQueryParam.json \
intermediateCollectionNoPostmanID.json \
intermediateCollectionNoCircular.json \
intermediateCollectionWithName.json \
intermediateCollectionWithDescription.json \
intermediateCollectionWithBaseURL.json \
intermediateCollectionWithLinks.json \
intermediateCollectionPostBody.json \
intermediateCollectionWithNoVar.json
intermediateCollectionDisableQueryParam.json \
intermediateCollectionNoPostmanID.json \
intermediateCollectionNoCircular.json \
intermediateCollectionWithName.json \
intermediateCollectionWithDescription.json \
intermediateCollectionWithBaseURL.json \
intermediateCollectionWithLinks.json \
intermediateCollectionPostBody.json \
intermediateCollectionWithNoVar.json

popd -0
2 changes: 1 addition & 1 deletion tools/postman/scripts/transform-postman.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function loadJsonFile(filePath) {
}

function saveJsonFile(filePath, json) {
fs.writeFileSync(filePath, JSON.stringify(json, null, 2), 'utf8');
fs.writeFileSync(filePath, JSON.stringify(json, null, 0), 'utf8');
}

// hack
Expand Down