fix for #632, param names other than
This commit is contained in:
3
dist/index.html
vendored
3
dist/index.html
vendored
@@ -20,8 +20,6 @@
|
|||||||
<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">
|
||||||
@@ -34,7 +32,6 @@
|
|||||||
}
|
}
|
||||||
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){
|
||||||
|
|||||||
114
dist/lib/swagger-client.js
vendored
114
dist/lib/swagger-client.js
vendored
@@ -1,5 +1,61 @@
|
|||||||
// swagger-client.js
|
// swagger-client.js
|
||||||
// version 2.1.0-alpha.1
|
// version 2.1.0-alpha.1
|
||||||
|
/**
|
||||||
|
* Array Model
|
||||||
|
**/
|
||||||
|
var ArrayModel = function(definition) {
|
||||||
|
this.name = "name";
|
||||||
|
this.definition = definition || {};
|
||||||
|
this.properties = [];
|
||||||
|
this.type;
|
||||||
|
this.ref;
|
||||||
|
|
||||||
|
var requiredFields = definition.enum || [];
|
||||||
|
var items = definition.items;
|
||||||
|
if(items) {
|
||||||
|
var type = items.type;
|
||||||
|
if(items.type) {
|
||||||
|
this.type = typeFromJsonSchema(type.type, type.format);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.ref = items['$ref'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayModel.prototype.createJSONSample = function(modelsToIgnore) {
|
||||||
|
var result;
|
||||||
|
modelsToIgnore = (modelsToIgnore||{})
|
||||||
|
if(this.type) {
|
||||||
|
result = type;
|
||||||
|
}
|
||||||
|
else if (this.ref) {
|
||||||
|
var name = simpleRef(this.ref);
|
||||||
|
result = models[name].createJSONSample();
|
||||||
|
}
|
||||||
|
return [ result ];
|
||||||
|
};
|
||||||
|
|
||||||
|
ArrayModel.prototype.getSampleValue = function(modelsToIgnore) {
|
||||||
|
var result;
|
||||||
|
modelsToIgnore = (modelsToIgnore || {})
|
||||||
|
if(this.type) {
|
||||||
|
result = type;
|
||||||
|
}
|
||||||
|
else if (this.ref) {
|
||||||
|
var name = simpleRef(this.ref);
|
||||||
|
result = models[name].getSampleValue(modelsToIgnore);
|
||||||
|
}
|
||||||
|
return [ result ];
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayModel.prototype.getMockSignature = function(modelsToIgnore) {
|
||||||
|
var propertiesStr = [];
|
||||||
|
|
||||||
|
if(this.ref) {
|
||||||
|
return models[simpleRef(this.ref)].getMockSignature();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SwaggerAuthorizations applys the correct authorization to an operation being executed
|
* SwaggerAuthorizations applys the correct authorization to an operation being executed
|
||||||
@@ -96,63 +152,7 @@ PasswordAuthorization.prototype.apply = function(obj, authorizations) {
|
|||||||
var base64encoder = this._btoa;
|
var base64encoder = this._btoa;
|
||||||
obj.headers["Authorization"] = "Basic " + base64encoder(this.username + ":" + this.password);
|
obj.headers["Authorization"] = "Basic " + base64encoder(this.username + ":" + this.password);
|
||||||
return true;
|
return true;
|
||||||
};/**
|
};var __bind = function(fn, me){
|
||||||
* Array Model
|
|
||||||
**/
|
|
||||||
var ArrayModel = function(definition) {
|
|
||||||
this.name = "name";
|
|
||||||
this.definition = definition || {};
|
|
||||||
this.properties = [];
|
|
||||||
this.type;
|
|
||||||
this.ref;
|
|
||||||
|
|
||||||
var requiredFields = definition.enum || [];
|
|
||||||
var items = definition.items;
|
|
||||||
if(items) {
|
|
||||||
var type = items.type;
|
|
||||||
if(items.type) {
|
|
||||||
this.type = typeFromJsonSchema(type.type, type.format);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.ref = items['$ref'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayModel.prototype.createJSONSample = function(modelsToIgnore) {
|
|
||||||
var result;
|
|
||||||
modelsToIgnore = (modelsToIgnore||{})
|
|
||||||
if(this.type) {
|
|
||||||
result = type;
|
|
||||||
}
|
|
||||||
else if (this.ref) {
|
|
||||||
var name = simpleRef(this.ref);
|
|
||||||
result = models[name].createJSONSample();
|
|
||||||
}
|
|
||||||
return [ result ];
|
|
||||||
};
|
|
||||||
|
|
||||||
ArrayModel.prototype.getSampleValue = function(modelsToIgnore) {
|
|
||||||
var result;
|
|
||||||
modelsToIgnore = (modelsToIgnore || {})
|
|
||||||
if(this.type) {
|
|
||||||
result = type;
|
|
||||||
}
|
|
||||||
else if (this.ref) {
|
|
||||||
var name = simpleRef(this.ref);
|
|
||||||
result = models[name].getSampleValue(modelsToIgnore);
|
|
||||||
}
|
|
||||||
return [ result ];
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayModel.prototype.getMockSignature = function(modelsToIgnore) {
|
|
||||||
var propertiesStr = [];
|
|
||||||
|
|
||||||
if(this.ref) {
|
|
||||||
return models[simpleRef(this.ref)].getMockSignature();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var __bind = function(fn, me){
|
|
||||||
return function(){
|
return function(){
|
||||||
return fn.apply(me, arguments);
|
return fn.apply(me, arguments);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -828,6 +828,8 @@ Operation.prototype.execute = function(arg1, arg2, arg3, arg4, parent) {
|
|||||||
headers[param.name] = args[param.name];
|
headers[param.name] = args[param.name];
|
||||||
else if (param.in === 'formData')
|
else if (param.in === 'formData')
|
||||||
formParams[param.name] = args[param.name];
|
formParams[param.name] = args[param.name];
|
||||||
|
else if (param.in === 'body')
|
||||||
|
args.body = args[param.name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// handle form params
|
// handle form params
|
||||||
|
|||||||
Reference in New Issue
Block a user