Skip to content

Instantly share code, notes, and snippets.

@mythes
Last active August 22, 2018 08:49
Show Gist options
  • Save mythes/6a14c926c53f519fd695a505fc1319a9 to your computer and use it in GitHub Desktop.
Save mythes/6a14c926c53f519fd695a505fc1319a9 to your computer and use it in GitHub Desktop.
#swagger #console #parser #js
// 1. open swagger url
// 2. paste into console
// 3. execute
document.querySelectorAll(".endpoint").forEach(function(e) {
let method = e
.querySelector(".http_method > .toggleOperation")
.textContent.toUpperCase();
let path = e.querySelector(".path > .toggleOperation").textContent;
let result = method + " " + path;
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment