Merge branch 'master' of github.com:swagger-api/swagger-ui
This commit is contained in:
@@ -32,10 +32,9 @@ You can use the swagger-ui code AS-IS! No need to build or recompile--just clon
|
|||||||
You can rebuild swagger-ui on your own to tweak it or just so you can say you did. To do so, follow these steps:
|
You can rebuild swagger-ui on your own to tweak it or just so you can say you did. To do so, follow these steps:
|
||||||
|
|
||||||
1. install [handlebars](http://handlebarsjs.com/)
|
1. install [handlebars](http://handlebarsjs.com/)
|
||||||
2. install java
|
2. npm install
|
||||||
3. npm install
|
3. npm run-script build
|
||||||
4. npm run-script build
|
4. You should see the distribution under the dist folder. Open ./dist/index.html to launch Swagger UI in a browser
|
||||||
5. You should see the distribution under the dist folder. Open ./dist/index.html to launch Swagger UI in a browser
|
|
||||||
|
|
||||||
### Use
|
### Use
|
||||||
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.wordnik.com/api/api-docs) service and show its APIs. You can enter your own server url and click explore to view the API.
|
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.wordnik.com/api/api-docs) service and show its APIs. You can enter your own server url and click explore to view the API.
|
||||||
|
|||||||
@@ -420,6 +420,9 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
|
|||||||
if(typeof response.paths[path] === 'object') {
|
if(typeof response.paths[path] === 'object') {
|
||||||
var httpMethod;
|
var httpMethod;
|
||||||
for(httpMethod in response.paths[path]) {
|
for(httpMethod in response.paths[path]) {
|
||||||
|
if(['delete', 'get', 'head', 'options', 'patch', 'post', 'put'].indexOf(httpMethod) === -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
var operation = response.paths[path][httpMethod];
|
var operation = response.paths[path][httpMethod];
|
||||||
var tags = operation.tags;
|
var tags = operation.tags;
|
||||||
if(typeof tags === 'undefined') {
|
if(typeof tags === 'undefined') {
|
||||||
@@ -997,7 +1000,7 @@ Operation.prototype.encodeCollection = function(type, name, value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO this encoding needs to be changed
|
* TODO this encoding needs to be changed
|
||||||
**/
|
**/
|
||||||
Operation.prototype.encodeQueryParam = function(arg) {
|
Operation.prototype.encodeQueryParam = function(arg) {
|
||||||
return escape(arg);
|
return escape(arg);
|
||||||
@@ -1037,7 +1040,7 @@ var Model = function(name, definition) {
|
|||||||
if(requiredFields.indexOf(key) >= 0)
|
if(requiredFields.indexOf(key) >= 0)
|
||||||
required = true;
|
required = true;
|
||||||
this.properties.push(new Property(key, property, required));
|
this.properties.push(new Property(key, property, required));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1216,7 +1219,7 @@ Property.prototype.toString = function() {
|
|||||||
str += ', <span class="propOptKey">optional</span>';
|
str += ', <span class="propOptKey">optional</span>';
|
||||||
str += ')';
|
str += ')';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
str = this.name + ' (' + JSON.stringify(this.obj) + ')';
|
str = this.name + ' (' + JSON.stringify(this.obj) + ')';
|
||||||
|
|
||||||
if(typeof this.description !== 'undefined')
|
if(typeof this.description !== 'undefined')
|
||||||
@@ -1480,4 +1483,4 @@ ShredHttpClient.prototype.execute = function(obj) {
|
|||||||
obj.on = res;
|
obj.on = res;
|
||||||
}
|
}
|
||||||
return this.shred.request(obj);
|
return this.shred.request(obj);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user