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
{ | |
"swagger": "2.0", | |
"host": "petstore.swagger.wordnik.com", | |
"info": { | |
"title": "Test Spec", | |
"version": "1.0.0" | |
}, | |
"paths": { | |
"/road": { | |
"get": { |
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
{ | |
"swagger": "2.0", | |
"basePath": "http://localhost:3000/s/", | |
"host": "petstore.swagger.wordnik.com", | |
"info": { | |
"title": "swagger-ui#1234", | |
"title": "Describe your issue here", | |
"version": "1.0.0" | |
}, | |
"paths": { |
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
{ | |
"swagger": "2.0", | |
"host": "petstore.swagger.wordnik.com", | |
"info": { | |
"title": "swagger-ui#1234", | |
"title": "Describe your issue here", | |
"version": "1.0.0" | |
}, | |
"paths": { | |
"/road": { |
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
var client = require('swagger-client'); | |
var swagger = new client({ | |
url: 'http://petstore.swagger.io/v2/swagger.json', | |
success: function() { | |
swagger.apis.pet.getPetById({petId:10},function(pet){ | |
console.log('pet', pet); | |
}); |
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
// This goes in the dist/index.html file found in swagger-ui. | |
// Be careful that the file gets overwritten when you build swagger-ui | |
window.swaggerUi = new SwaggerUi({ | |
url: url, | |
spec: { | |
// ... | |
// your spec here | |
// .... | |
}, |
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
//... | |
window.swaggerUi = new SwaggerUi({ | |
url: url, | |
dom_id: "swagger-ui-container", | |
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'], | |
onComplete: function(swaggerApi, swaggerUi){ | |
if(typeof initOAuth == "function") { | |
initOAuth({ | |
clientId: "your-client-id", | |
realm: "your-realms", |
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
this.fetch = function() { | |
url = this.url.value | |
$.getJSON(url).then(function(data){ | |
opts.data.trigger('change', data); | |
}).fail(function() { | |
console.error('Failed to load/parse json data from', url); | |
console.error(arguments); | |
}) | |
} |
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
// ... | |
window.swaggerUi = new SwaggerUi({ | |
url: url, | |
useJQuery: true, | |
authorizations: { | |
makeCredentialed: function() { | |
this.xhrFields = {withCredentials: true}; // The important bit, along with useJQuery | |
return true; | |
} | |
}, |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "Smoke Signals v1", | |
"description": "Close to the metal communication with a Ron from middle-east", | |
"version": "1.0.0" | |
}, | |
"host": "large-mountain-in.africa", | |
"schemes": [ | |
"http" |
OlderNewer