swagger-api / swagger-api/swagger-ui

tagSorter and operationSorter options on Docker

Open
#6,154 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: configuration cat: docker Hacktoberfest type: feature
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

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.

スクリーンショット 2020-06-17 19 23 40 スクリーンショット 2020-06-17 19 23 43

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docker/configurator/variables.js and compare its supported environment variables with the Swagger UI configuration options for tagSorter and operationSorter. Validate the proposed string mappings in a local Docker environment; done means both options can be passed through the container and control the displayed sorting.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript
Domain
devops
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.