swagger-api/swagger-ui

tagSorter and operationSorter options on Docker

Open

#6,154 opened on Jun 17, 2020

View on GitHub
 (3 comments) (2 reactions) (0 assignees)JavaScript (8,801 forks)batch import
Hacktoberfestcat: configurationcat: dockertype: feature

Repository metrics

Stars
 (25,447 stars)
PR merge metrics
 (Avg merge 20h 34m) (14 merged PRs in 30d)

Description

Content & configuration

I want to specify tagSorter and operationSorter in a Docker container. But according to the docs here, unfortunately it doesn't support passing tagSorter and operationSorter via environment variable.

Any reasons why these two options are unavailable on Docker? I think we could pass a value as string like 'alpha' / 'method' at least.

Describe the solution you'd like

What I did to solve this is to add tagSorter and operationSorter to the variable list defined in ./docker/configurator/variables.js like this:

+  OPERATION_SORTER: {
+    type: "string",
+    name: "operationsSorter"
+  },
   SHOW_EXTENSIONS: {
     type: "boolean",
     name: "showExtensions"
   },
   SHOW_COMMON_EXTENSIONS: {
     type: "boolean",
     name: "showCommonExtensions"
   },
+  TAG_SORTER: {
+    type: "string",
+    name: "tagsSorter"
+  },

I tested it and It worked well on my local environment, so if it looks good I'll make a PR.

Describe alternatives you've considered

Maybe we could sort at json file beforehand rather than passing sort options to Docker. But it would be still worth if we can pass the options to Docker.

Additional context

Contributor guide