Skip to content

Commit e295675

Browse files
author
Rob McGuinness
committed
fix tags sorting
1 parent 04530ad commit e295675

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const schema = Joi.object({
2626
documentationPage: Joi.boolean(),
2727
swaggerUI: Joi.boolean(),
2828
expanded: Joi.string().valid(['none', 'list', 'full']),
29-
sortTags: Joi.string().valid(['alpha', 'default']),
29+
sortTags: Joi.string().valid(['alpha']),
3030
sortEndpoints: Joi.string().valid(['alpha', 'method', 'ordered']),
3131
sortPaths: Joi.string().valid(['unsorted', 'path-method']),
3232
uiCompleteScript: Joi.string().allow(null),

optionsreference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
- `documentationPage`: (boolean) Add documentation page - default: `true`
5353
- `documentationPath`: (string) The path of the documentation page - default: `/documentation`
5454
- `expanded`: (string) If UI is expanded when opened. `none`, `list` or `full` - default: `list`
55-
- `sortTags`: (string) a sort method for `tags` i.e. groups in UI. `alpha`, `default` or `name`
55+
- `sortTags`: (string) a sort method for `tags` i.e. groups in UI. `alpha`
5656
- `alpha`: sort by paths alphanumerically
5757
- `sortEndpoints`: (string) a sort method for endpoints in UI. `alpha`, `method`, `ordered`.
5858
- `alpha`: sort by paths alphanumerically

public/extend.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// sort function for tag groups
22
var apisSorter = {
3-
alpha: 'alpha',
4-
default: function(a, b) {
5-
if (tags.indexOf(a.name) > -1 && tags.indexOf(b.name) > -1) {
6-
if (tags.indexOf(a.name) < tags.indexOf(b.name)) return -1;
7-
if (tags.indexOf(a.name) > tags.indexOf(b.name)) return 1;
8-
}
9-
return 0;
10-
}
3+
alpha: 'alpha'
114
};
125

136
// sort function for api endpoints within groups

templates/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@
5757
plugins: [SwaggerUIBundle.plugins.DownloadUrl],
5858
layout: 'StandaloneLayout',
5959
docExpansion: "{{hapiSwagger.expanded}}",
60-
apisSorter: apisSorter.{{hapiSwagger.sortTags}},
60+
tagsSorter: apisSorter.{{hapiSwagger.sortTags}},
6161
operationsSorter: operationsSorter.{{hapiSwagger.sortEndpoints}},
6262
}
6363

64-
// Begin Swagger UI call region
6564
var ui = SwaggerUIBundle(swaggerOptions);
6665

6766
window.ui = ui;

0 commit comments

Comments
 (0)