-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schema): add sortPaths option to sort swagger paths by alphabeti…
…cal order (cherry picked from commit 968aff8)
- Loading branch information
Showing
7 changed files
with
212 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
packages/specs/schema/src/utils/__snapshots__/generateSpec.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`generateSpec() > OS 3.0.1 > should generate spec with sorted paths 1`] = ` | ||
{ | ||
"info": { | ||
"title": "Api documentation", | ||
"version": "1.0.0", | ||
}, | ||
"openapi": "3.0.1", | ||
"paths": { | ||
"/rest/controller1": { | ||
"get": { | ||
"operationId": "controller1Method", | ||
"parameters": [], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
}, | ||
}, | ||
"tags": [ | ||
"Controller1", | ||
], | ||
}, | ||
}, | ||
"/rest/controller1/test": { | ||
"post": { | ||
"operationId": "controller1Method5", | ||
"parameters": [], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
}, | ||
}, | ||
"tags": [ | ||
"Controller1", | ||
], | ||
}, | ||
}, | ||
"/rest/controller1/{id}": { | ||
"get": { | ||
"operationId": "controller1MethodById", | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"required": true, | ||
"schema": { | ||
"type": "string", | ||
}, | ||
}, | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
}, | ||
}, | ||
"tags": [ | ||
"Controller1", | ||
], | ||
}, | ||
}, | ||
"/rest/controller2": { | ||
"get": { | ||
"operationId": "controller2Method", | ||
"parameters": [], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
}, | ||
}, | ||
"tags": [ | ||
"Controller2", | ||
], | ||
}, | ||
}, | ||
"/rest/controller2/{id}": { | ||
"get": { | ||
"operationId": "controller2MethodById", | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"required": true, | ||
"schema": { | ||
"type": "string", | ||
}, | ||
}, | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
}, | ||
}, | ||
"tags": [ | ||
"Controller2", | ||
], | ||
}, | ||
}, | ||
}, | ||
"tags": [ | ||
{ | ||
"name": "Controller2", | ||
}, | ||
{ | ||
"name": "Controller1", | ||
}, | ||
], | ||
} | ||
`; |
Oops, something went wrong.