fix for https://github.com/wordnik/swagger-ui/issues/644, verify path object by type
This commit is contained in:
3
dist/index.html
vendored
3
dist/index.html
vendored
@@ -19,7 +19,7 @@
|
|||||||
<script src='lib/swagger-client.js' type='text/javascript'></script>
|
<script src='lib/swagger-client.js' type='text/javascript'></script>
|
||||||
<script src='swagger-ui.js' type='text/javascript'></script>
|
<script src='swagger-ui.js' type='text/javascript'></script>
|
||||||
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
|
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
|
||||||
|
<script src='spec.js' type='text/javascript'></script>
|
||||||
<!-- enabling this will enable oauth2 implicit scope support -->
|
<!-- enabling this will enable oauth2 implicit scope support -->
|
||||||
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
|
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
}
|
}
|
||||||
window.swaggerUi = new SwaggerUi({
|
window.swaggerUi = new SwaggerUi({
|
||||||
url: url,
|
url: url,
|
||||||
|
spec: spec,
|
||||||
dom_id: "swagger-ui-container",
|
dom_id: "swagger-ui-container",
|
||||||
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
|
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
|
||||||
onComplete: function(swaggerApi, swaggerUi){
|
onComplete: function(swaggerApi, swaggerUi){
|
||||||
|
|||||||
2
dist/lib/swagger-client.js
vendored
2
dist/lib/swagger-client.js
vendored
@@ -412,6 +412,7 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
|||||||
var path;
|
var path;
|
||||||
var operations = [];
|
var operations = [];
|
||||||
for(path in response.paths) {
|
for(path in response.paths) {
|
||||||
|
if(typeof response.paths[path] === 'object') {
|
||||||
var httpMethod;
|
var httpMethod;
|
||||||
for(httpMethod in response.paths[path]) {
|
for(httpMethod in response.paths[path]) {
|
||||||
var operation = response.paths[path][httpMethod];
|
var operation = response.paths[path][httpMethod];
|
||||||
@@ -465,6 +466,7 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.isBuilt = true;
|
this.isBuilt = true;
|
||||||
if (this.success)
|
if (this.success)
|
||||||
this.success();
|
this.success();
|
||||||
|
|||||||
@@ -412,6 +412,7 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
|||||||
var path;
|
var path;
|
||||||
var operations = [];
|
var operations = [];
|
||||||
for(path in response.paths) {
|
for(path in response.paths) {
|
||||||
|
if(typeof response.paths[path] === 'object') {
|
||||||
var httpMethod;
|
var httpMethod;
|
||||||
for(httpMethod in response.paths[path]) {
|
for(httpMethod in response.paths[path]) {
|
||||||
var operation = response.paths[path][httpMethod];
|
var operation = response.paths[path][httpMethod];
|
||||||
@@ -465,6 +466,7 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.isBuilt = true;
|
this.isBuilt = true;
|
||||||
if (this.success)
|
if (this.success)
|
||||||
this.success();
|
this.success();
|
||||||
|
|||||||
Reference in New Issue
Block a user