mirror of
https://github.com/LukeHagar/api-specs.git
synced 2025-12-06 12:27:48 +00:00
added scripts to upload postman collection
This commit is contained in:
@@ -28,4 +28,5 @@ jobs:
|
|||||||
swagger-cli bundle --dereference idn/sailpoint-api.beta.yaml -t yaml -o dereferenced/deref-sailpoint-api.beta.yaml
|
swagger-cli bundle --dereference idn/sailpoint-api.beta.yaml -t yaml -o dereferenced/deref-sailpoint-api.beta.yaml
|
||||||
openapi2postmanv2 -s dereferenced/deref-sailpoint-api.beta.yaml -o postman/collections/sailpoint-api-beta.json -p -O folderStrategy=Tags,requestParametersResolution=Schema,exampleParametersResolution=Schema,disableOptionalParameters=true,optimizeConversion=false,stackLimit=50,alwaysInheritAuthentication=true
|
openapi2postmanv2 -s dereferenced/deref-sailpoint-api.beta.yaml -o postman/collections/sailpoint-api-beta.json -p -O folderStrategy=Tags,requestParametersResolution=Schema,exampleParametersResolution=Schema,disableOptionalParameters=true,optimizeConversion=false,stackLimit=50,alwaysInheritAuthentication=true
|
||||||
node postman-script/modify-collection.js postman/collections/sailpoint-api-beta.json
|
node postman-script/modify-collection.js postman/collections/sailpoint-api-beta.json
|
||||||
|
node postman-script/upload-script.js ${{secrets.POSTMAN_API_KEY}} Beta
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
|||||||
@@ -28,5 +28,5 @@ jobs:
|
|||||||
swagger-cli bundle --dereference idn/sailpoint-api.v3.yaml -t yaml -o dereferenced/deref-sailpoint-api.v3.yaml
|
swagger-cli bundle --dereference idn/sailpoint-api.v3.yaml -t yaml -o dereferenced/deref-sailpoint-api.v3.yaml
|
||||||
openapi2postmanv2 -s dereferenced/deref-sailpoint-api.v3.yaml -o postman/collections/sailpoint-api-v3.json -p -O folderStrategy=Tags,requestParametersResolution=Schema,exampleParametersResolution=Schema,disableOptionalParameters=true,optimizeConversion=false,stackLimit=50,alwaysInheritAuthentication=true
|
openapi2postmanv2 -s dereferenced/deref-sailpoint-api.v3.yaml -o postman/collections/sailpoint-api-v3.json -p -O folderStrategy=Tags,requestParametersResolution=Schema,exampleParametersResolution=Schema,disableOptionalParameters=true,optimizeConversion=false,stackLimit=50,alwaysInheritAuthentication=true
|
||||||
node postman-script/modify-collection.js postman/collections/sailpoint-api-v3.json
|
node postman-script/modify-collection.js postman/collections/sailpoint-api-v3.json
|
||||||
|
node postman-script/upload-script.js ${{secrets.POSTMAN_API_KEY}} V3
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ const fs = require('fs');
|
|||||||
|
|
||||||
// Function to recursively delete "auth" key from an object
|
// Function to recursively delete "auth" key from an object
|
||||||
const deleteAuthKey = (obj) => {
|
const deleteAuthKey = (obj) => {
|
||||||
for (const key in obj) {
|
for (const key in obj) {
|
||||||
if (typeof obj[key] === 'object') {
|
if (typeof obj[key] === 'object') {
|
||||||
deleteAuthKey(obj[key]); // Recursive call for nested objects
|
deleteAuthKey(obj[key]); // Recursive call for nested objects
|
||||||
}
|
|
||||||
if (key === 'auth') {
|
|
||||||
delete obj[key];
|
|
||||||
}
|
|
||||||
if (key === 'disabled') {
|
|
||||||
if (obj[key] === false) {
|
|
||||||
obj[key] = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
if (key === 'auth') {
|
||||||
|
delete obj[key];
|
||||||
|
}
|
||||||
|
if (key === 'disabled') {
|
||||||
|
if (obj[key] === false) {
|
||||||
|
obj[key] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const args = process.argv;
|
const args = process.argv;
|
||||||
|
|
||||||
// Read the JSON file
|
// Read the JSON file
|
||||||
fs.readFile(args[2], 'utf8', (err, data) => {
|
fs.readFile(args[2], 'utf8', (err, data) => {
|
||||||
@@ -45,8 +45,8 @@ fs.readFile(args[2], 'utf8', (err, data) => {
|
|||||||
} else if (args[2].includes("cc")) {
|
} else if (args[2].includes("cc")) {
|
||||||
jsonObject.variable = JSON.parse(fs.readFileSync('postman-script/variable-cc.json', 'utf8'));
|
jsonObject.variable = JSON.parse(fs.readFileSync('postman-script/variable-cc.json', 'utf8'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Write the modified JSON content back to the file
|
// Write the modified JSON content back to the file
|
||||||
fs.writeFile(args[2], JSON.stringify(jsonObject, null, 2), (writeErr) => {
|
fs.writeFile(args[2], JSON.stringify(jsonObject, null, 2), (writeErr) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user