mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 14:45:28 +00:00
Swagger UI: Updating swagger-ui.js to list the resources and operations
in sorted order.
This commit is contained in:
3
third_party/swagger-ui/README.md
vendored
3
third_party/swagger-ui/README.md
vendored
@@ -13,8 +13,9 @@ Instructions on how to use these:
|
||||
https://github.com/swagger-api/swagger-ui#how-to-use-it
|
||||
|
||||
## 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
|
||||
- Modified swagger-ui.js to list resources and operations in sorted order.
|
||||
|
||||
LICENSE file has been created for compliance purposes.
|
||||
Not included in original distribution.
|
||||
|
6
third_party/swagger-ui/swagger-ui.js
vendored
6
third_party/swagger-ui/swagger-ui.js
vendored
@@ -1617,7 +1617,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
||||
$(this.el).html(Handlebars.templates.main(this.model));
|
||||
resources = {};
|
||||
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++) {
|
||||
resource = _ref3[_i];
|
||||
id = resource.name;
|
||||
@@ -1679,7 +1679,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
||||
if (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++) {
|
||||
operation = _ref4[_i];
|
||||
counter = 0;
|
||||
|
Reference in New Issue
Block a user