File tree Expand file tree Collapse file tree 8 files changed +112
-40
lines changed Expand file tree Collapse file tree 8 files changed +112
-40
lines changed Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.ADMIN_DEFINITION_ID}}
25
25
FILE_PATH="index.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.DEFINITION_ID}}
25
25
FILE_PATH="click/schema.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.CONNECT_DEFINITION_ID}}
25
25
FILE_PATH="index.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.ESIGN_DEFINITION_ID}}
25
25
FILE_PATH="index.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.MAESTRO_DEFINITION_ID}}
25
25
FILE_PATH="index.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.MONITOR_DEFINITION_ID}}
25
25
FILE_PATH="index.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.ROOMS_DEFINITION_ID}}
25
25
FILE_PATH="index.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
Original file line number Diff line number Diff line change 24
24
SCHEMA_ID=${{vars.WEBFORMS_DEFINITION_ID}}
25
25
FILE_PATH="index.json"
26
26
27
- CONTENT=$(jq -Rs . < ${SWAGGER_FILE})
27
+ # Read the Swagger file content and escape it properly for JSON
28
+ CONTENT=$(cat "$SWAGGER_FILE" | jq -Rs .)
29
+
30
+ # Create the JSON payload with the file content as a string
31
+ JSON_PAYLOAD="{\"content\": $CONTENT}"
32
+
33
+ # Write the JSON payload to a temporary file
34
+ echo "$JSON_PAYLOAD" > payload.json
35
+
36
+ # Use curl with --data-binary to handle large file content
28
37
curl --location --request PUT "https://api.getpostman.com/apis/$API_ID/schemas/$SCHEMA_ID/files/$FILE_PATH" \
29
- --header "Accept: application/vnd.api.v10+json" \
30
- --header "Content-Type: application/json" \
31
- --header "X-Api-Key: $POSTMAN_API_KEY" \
32
- --data "{\"content\": ${CONTENT}}"
38
+ --header "Accept: application/vnd.api.v10+json" \
39
+ --header "Content-Type: application/json" \
40
+ --header "X-Api-Key: $POSTMAN_API_KEY" \
41
+ --data-binary @payload.json
You can’t perform that action at this time.
0 commit comments