Last active
September 19, 2017 17:23
-
-
Save gsemino/d75b2b3fc4ff4f1cece65413cb9044ac to your computer and use it in GitHub Desktop.
This is a Runscope template for syncing your oas file in Stoplight with GitHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"trigger_url": "https://api.runscope.com/radar/81de52ef-ccf6-4063-ba43-d4755b29d05f/trigger", | |
"name": "Stoplight-GitHub Sync", | |
"version": "1.0", | |
"exported_at": 1505331232, | |
"steps": [ | |
{ | |
"headers": {}, | |
"url": "https://api.stoplight.io/v1/versions/version-id-here/export/oas.json", | |
"variables": [ | |
{ | |
"source": "response_text", | |
"name": "json_body" | |
} | |
], | |
"multipart_form": [], | |
"step_type": "request", | |
"auth": {}, | |
"note": "Get OAS JSON", | |
"fragment": "", | |
"assertions": [ | |
{ | |
"comparison": "equal_number", | |
"value": 200, | |
"source": "response_status" | |
}, | |
{ | |
"comparison": "not_empty", | |
"value": null, | |
"source": "response_text" | |
} | |
], | |
"scripts": [], | |
"before_scripts": [], | |
"method": "GET" | |
}, | |
{ | |
"url": "https://api.github.com/repos/your-org-or-username/your-repo/path/to/oas.json", | |
"variables": [ | |
{ | |
"source": "response_json", | |
"property": "sha", | |
"name": "current_sha" | |
} | |
], | |
"multipart_form": [], | |
"step_type": "request", | |
"auth": {}, | |
"fragment": "", | |
"note": "Get SHA for Specific File", | |
"headers": { | |
"Authorization": [ | |
"token 12345678910" | |
] | |
}, | |
"assertions": [ | |
{ | |
"comparison": "equal_number", | |
"value": 200, | |
"source": "response_status" | |
}, | |
{ | |
"comparison": "not_empty", | |
"property": "", | |
"value": null, | |
"source": "response_json" | |
} | |
], | |
"scripts": [], | |
"before_scripts": [], | |
"method": "GET" | |
}, | |
{ | |
"body": "{\r\n \"message\": \"updated-runscope-{{timestamp}}\",\r\n \"sha\": \"{{current_sha}}\",\r\n \"content\": \"{{encode_base64({{json_body}})}}\"\r\n\r\n}", | |
"form": {}, | |
"url": "https://api.github.com/repos/your-org-or-username/your-repo/path/to/oas.json", | |
"variables": [], | |
"multipart_form": [], | |
"step_type": "request", | |
"auth": {}, | |
"fragment": "", | |
"note": "Commit on the Specific File", | |
"headers": { | |
"Content-Type": [ | |
"application/json" | |
], | |
"Authorization": [ | |
"token 12345678910" | |
] | |
}, | |
"assertions": [ | |
{ | |
"comparison": "equal_number", | |
"value": 200, | |
"source": "response_status" | |
}, | |
{ | |
"comparison": "not_empty", | |
"property": "", | |
"value": null, | |
"source": "response_json" | |
} | |
], | |
"scripts": [], | |
"before_scripts": [], | |
"method": "PUT" | |
} | |
], | |
"description": "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment