swagger-api/swagger-ui

tagSorter and operationSorter options on Docker

Open

#6,154 创建于 2020年6月17日

在 GitHub 查看
 (3 评论) (2 反应) (0 负责人)JavaScript (8,801 fork)batch import
Hacktoberfestcat: configurationcat: dockertype: feature

仓库指标

Star
 (25,447 star)
PR 合并指标
 (平均合并 20小时 34分钟) (30 天内合并 14 个 PR)

描述

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

贡献者指南