diff --git a/docker/configurator/translator.js b/docker/configurator/translator.js index 0ad4077ee88..c8f2eeca7bf 100644 --- a/docker/configurator/translator.js +++ b/docker/configurator/translator.js @@ -50,6 +50,13 @@ const defaultBaseConfig = { type: "boolean", base: true, } + }, + operationsSorter: { + value: "none", + schema: { + type: "string", + base: true + } } } diff --git a/docker/configurator/variables.js b/docker/configurator/variables.js index 1e676c4f1ea..ebc6b7f4194 100644 --- a/docker/configurator/variables.js +++ b/docker/configurator/variables.js @@ -106,6 +106,10 @@ const standardVariables = { WITH_CREDENTIALS: { type: "boolean", name: "withCredentials", + }, + OPERATIONS_SORTER: { + type: "string", + name: "operationsSorter", } } diff --git a/docs/usage/configuration.md b/docs/usage/configuration.md index b4b28e1cb92..2f5d10090d8 100644 --- a/docs/usage/configuration.md +++ b/docs/usage/configuration.md @@ -139,7 +139,7 @@ Parameter name | Docker variable | Description
operationsSorter
OPERATIONS_SORTERFunction=(a => a). Apply a sort to the operation
list of each API. It can be 'alpha' (sort by paths
alphanumerically), 'method' (sort by HTTP method) or a function (see
diff --git a/test/unit/docker/translator.js b/test/unit/docker/translator.js
index 28291971c29..5bff43241f7 100644
--- a/test/unit/docker/translator.js
+++ b/test/unit/docker/translator.js
@@ -147,6 +147,15 @@ describe("docker: env translator", function() {
))
})
+ it("should generate operationsSorter configuration prop", function () {
+ const input = {
+ OPERATIONS_SORTER: "alpha"
+ }
+
+ expect(translator(input)).toEqual(dedent(`operationsSorter: alpha,`))
+
+ })
+
it("should generate an object config", function () {
const input = {
SPEC: `{ swagger: "2.0" }`