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
//... | |
window.swaggerUi = new SwaggerUi({ | |
url: url, | |
dom_id: "swagger-ui-container", | |
authorizations: { | |
someName: function() { | |
// This function will get called /before/ each request | |
// ... UNLESS you have a 'security' tag in the swagger.json file, in which case you must add 'someName' to the list of auths. | |
console.log('explore the request object...',this) // Take a look in the console tab to see what's available. | |
this.headers['x-swagger'] = 'value'; // Example header |
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" |
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
[WARNING] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Build Order: | |
[INFO] | |
[INFO] XXXXXXXXXXX | |
[INFO] commons | |
[INFO] XXXXXXXX-api | |
[INFO] auth-api | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ |
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", | |
authorizations: { | |
someName: new SwaggerClient.PasswordAuthorization("", "<username>", "<password>") | |
} | |
// ........... |
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: '', | |
spec: { | |
// The json contents of your spec file | |
} | |
dom_id: "swagger-ui-container", | |
// ........... |
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
<script> | |
// ... | |
var selectedUrl = "One"; | |
var spec = { | |
"One": "/One.json", | |
"Two": "/Two.json" | |
} | |
function updateMultipleSpecs() { |
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: Uber API 2 | |
description: Move your app forward with the Uber API | |
version: 1.0.0 | |
host: api.uber.com | |
schemes: | |
- https | |
basePath: /v1 | |
produces: |