swagger-api/swagger-ui

tagSorter and operationSorter options on Docker

Open

#6154 aperta il 17 giu 2020

Vedi su GitHub
 (3 commenti) (2 reazioni) (0 assegnatari)JavaScript (8801 fork)batch import
Hacktoberfestcat: configurationcat: dockertype: feature

Metriche repository

Star
 (25.447 star)
Metriche merge PR
 (Merge medio 20h 34m) (14 PR mergiate in 30 g)

Descrizione

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

Guida contributor