Commit 87c9c374 authored by nikhiljindal's avatar nikhiljindal

Swagger UI: Updating swagger-ui.js to list the resources and operations

in sorted order.
parent f8db96b6
...@@ -13,8 +13,9 @@ Instructions on how to use these: ...@@ -13,8 +13,9 @@ Instructions on how to use these:
https://github.com/swagger-api/swagger-ui#how-to-use-it https://github.com/swagger-api/swagger-ui#how-to-use-it
## Local Modifications ## Local Modifications
Updated the url to "../../swaggerapi" as per instructions at: - Updated the url to "../../swaggerapi" as per instructions at:
https://github.com/swagger-api/swagger-ui#how-to-use-it https://github.com/swagger-api/swagger-ui#how-to-use-it
- Modified swagger-ui.js to list resources and operations in sorted order.
LICENSE file has been created for compliance purposes. LICENSE file has been created for compliance purposes.
Not included in original distribution. Not included in original distribution.
...@@ -1617,7 +1617,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; ...@@ -1617,7 +1617,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
$(this.el).html(Handlebars.templates.main(this.model)); $(this.el).html(Handlebars.templates.main(this.model));
resources = {}; resources = {};
counter = 0; counter = 0;
_ref3 = this.model.apisArray; _ref3 = _.sortBy(this.model.apisArray, function(resource) { return resource.name;});
for (_i = 0, _len = _ref3.length; _i < _len; _i++) { for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
resource = _ref3[_i]; resource = _ref3[_i];
id = resource.name; id = resource.name;
...@@ -1679,7 +1679,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; ...@@ -1679,7 +1679,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
if (this.model.description) { if (this.model.description) {
this.model.summary = this.model.description; this.model.summary = this.model.description;
} }
_ref4 = this.model.operationsArray;
// Sort the operations by path and method (get/post).
_ref4 = _.sortBy(this.model.operationsArray, function(operation) { return [operation.path, operation.method];});
for (_i = 0, _len = _ref4.length; _i < _len; _i++) { for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
operation = _ref4[_i]; operation = _ref4[_i];
counter = 0; counter = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment