Skip to content

Commit

Permalink
feat: sort parameters and object schema props, hoise required ones to…
Browse files Browse the repository at this point in the history
… the top
  • Loading branch information
brotheroftux committed Jun 16, 2024
1 parent 99c20d5 commit 18aab67
Show file tree
Hide file tree
Showing 26 changed files with 886 additions and 280 deletions.
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: '.test.ts$',
rootDir: 'src/__tests__',
snapshotResolver: '../../jest.snapshots.js',
rootDir: '.',
snapshotResolver: './jest.snapshots.js',
};
4 changes: 2 additions & 2 deletions jest.snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ module.exports = {
testPathForConsistencyCheck: 'src/__tests__/basic.test.ts',

resolveSnapshotPath: (testPath, snapshotExtension) => {
return testPath.replace('src/__tests__', 'src/__snapshots__/') + snapshotExtension;
return testPath.replace('src/__tests__', 'src/__snapshots__') + snapshotExtension;
},

resolveTestPath: (snapshotFilePath, snapshotExtension) => {
return snapshotFilePath
.replace('src/__snapshots__/', 'src/__tests__')
.replace('src/__snapshots__', 'src/__tests__')
.slice(0, -snapshotExtension.length);
},
};
10 changes: 9 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@types/js-yaml": "^4.0.5",
"@types/json-schema": "^7.0.11",
"@types/json-stringify-safe": "^5.0.0",
"@types/lodash": "^4.17.5",
"@types/markdown-it": "^13.0.7",
"@types/react": "^18.0.35",
"@types/react-dom": "^18.0.11",
Expand All @@ -74,6 +75,7 @@
"glob": "^8.0.3",
"jest": "^29.5.0",
"jest-when": "^3.5.2",
"lodash": "^4.17.21",
"markdown-it": "^13.0.2",
"npm-run-all": "^4.1.5",
"openapi-types": "^12.1.3",
Expand Down
8 changes: 4 additions & 4 deletions src/__snapshots__/basic.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Base 200 response
||
||
type
foo
|
**Type:** string
Expand All @@ -70,7 +70,7 @@ Base 200 response
||
||
foo
type
|
**Type:** string
Expand Down Expand Up @@ -113,7 +113,7 @@ Base 200 response
||
||
type
bar
|
**Type:** string
Expand All @@ -122,7 +122,7 @@ Base 200 response
||
||
bar
type
|
**Type:** string
Expand Down
22 changes: 11 additions & 11 deletions src/__snapshots__/combiners/allOf.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Generated server url
||
||
type
foo
|
**Type:** string
Expand All @@ -63,7 +63,7 @@ Generated server url
||
||
foo
name
|
**Type:** string
Expand All @@ -72,7 +72,7 @@ Generated server url
||
||
name
type
|
**Type:** string
Expand Down Expand Up @@ -115,24 +115,24 @@ Base 200 response
||
||
name
baz
|
**Type:** string
<span class="openapi-description-annotation">Default:</span> \`a\`
||
||
type
name
|
**Type:** string
<span class="openapi-description-annotation">Default:</span> \`a\`
||
||
baz
type
|
**Type:** string
Expand Down Expand Up @@ -226,7 +226,7 @@ Cat class
||
||
type
foo
|
**Type:** string
Expand All @@ -235,7 +235,7 @@ Cat class
||
||
foo
type
|
**Type:** string
Expand Down
36 changes: 18 additions & 18 deletions src/__snapshots__/combiners/complex.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ Generated server url
||
||
name
age
|
**Type:** string
**Type:** any
<span class="openapi-description-annotation">Default:</span> \`b\`
||
||
age
name
|
**Type:** any
**Type:** string
<span class="openapi-description-annotation">Default:</span> \`b\`
||
||
Expand Down Expand Up @@ -104,7 +104,7 @@ Dog class
||
||
type
bar
|
**Type:** string
Expand All @@ -113,7 +113,7 @@ Dog class
||
||
bar
type
|
**Type:** string
Expand All @@ -136,7 +136,7 @@ Cat class
||
||
type
foo
|
**Type:** string
Expand All @@ -145,7 +145,7 @@ Cat class
||
||
foo
type
|
**Type:** string
Expand Down Expand Up @@ -192,20 +192,20 @@ Base 200 response
||
||
name
age
|
**Type:** string
**Type:** any
<span class="openapi-description-annotation">Default:</span> \`b\`
||
||
age
name
|
**Type:** any
**Type:** string
<span class="openapi-description-annotation">Default:</span> \`b\`
||
||
Expand Down
Loading

0 comments on commit 18aab67

Please sign in to comment.