Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docker/configurator/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ const defaultBaseConfig = {
type: "boolean",
base: true,
}
},
operationsSorter: {
value: "none",
schema: {
type: "string",
base: true
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions docker/configurator/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ const standardVariables = {
WITH_CREDENTIALS: {
type: "boolean",
name: "withCredentials",
},
OPERATIONS_SORTER: {
type: "string",
name: "operationsSorter",
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Parameter name | Docker variable | Description
<td>
<a name="user-content-operationssorter"></a><code>operationsSorter</code>
</td>
<td><em>Unavailable</em></td>
<td><code>OPERATIONS_SORTER</code></td>
<td><code>Function=(a =&gt; a)</code>. 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
Expand Down
9 changes: 9 additions & 0 deletions test/unit/docker/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" }`
Expand Down