Skip to content

Commit 685029f

Browse files
committed
fix: pascal case
1 parent 0249ce4 commit 685029f

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

src/openApi/v2/parser/getType.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ describe('getType', () => {
5151

5252
it('should support dot', () => {
5353
const type = getType('#/definitions/model.000');
54-
expect(type.type).toEqual('model_000');
55-
expect(type.base).toEqual('model_000');
54+
expect(type.type).toEqual('Model000');
55+
expect(type.base).toEqual('Model000');
5656
expect(type.template).toEqual(null);
57-
expect(type.imports).toEqual(['model_000']);
57+
expect(type.imports).toEqual(['Model000']);
5858
});
5959

6060
it('should support dashes', () => {
6161
const type = getType('#/definitions/some_special-schema');
62-
expect(type.type).toEqual('some_special_schema');
63-
expect(type.base).toEqual('some_special_schema');
62+
expect(type.type).toEqual('SomeSpecialSchema');
63+
expect(type.base).toEqual('SomeSpecialSchema');
6464
expect(type.template).toEqual(null);
65-
expect(type.imports).toEqual(['some_special_schema']);
65+
expect(type.imports).toEqual(['SomeSpecialSchema']);
6666
});
6767

6868
it('should support dollar sign', () => {
6969
const type = getType('#/definitions/$some+special+schema');
70-
expect(type.type).toEqual('$some_special_schema');
71-
expect(type.base).toEqual('$some_special_schema');
70+
expect(type.type).toEqual('$SomeSpecialSchema');
71+
expect(type.base).toEqual('$SomeSpecialSchema');
7272
expect(type.template).toEqual(null);
73-
expect(type.imports).toEqual(['$some_special_schema']);
73+
expect(type.imports).toEqual(['$SomeSpecialSchema']);
7474
});
7575
});

test/__snapshots__/index.spec.ts.snap

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
563563
export { OpenAPI } from './core/OpenAPI';
564564
export type { OpenAPIConfig } from './core/OpenAPI';
565565

566-
export type { _default } from './models/_default';
567566
export type { ArrayWithArray } from './models/ArrayWithArray';
568567
export type { ArrayWithBooleans } from './models/ArrayWithBooleans';
569568
export type { ArrayWithNumbers } from './models/ArrayWithNumbers';
@@ -577,6 +576,7 @@ export type { CommentWithQuotes } from './models/CommentWithQuotes';
577576
export type { CommentWithReservedCharacters } from './models/CommentWithReservedCharacters';
578577
export type { CommentWithSlashes } from './models/CommentWithSlashes';
579578
export type { Date } from './models/Date';
579+
export type { Default } from './models/Default';
580580
export type { DictionaryWithArray } from './models/DictionaryWithArray';
581581
export type { DictionaryWithDictionary } from './models/DictionaryWithDictionary';
582582
export type { DictionaryWithProperties } from './models/DictionaryWithProperties';
@@ -612,7 +612,6 @@ export type { SimpleReference } from './models/SimpleReference';
612612
export type { SimpleString } from './models/SimpleString';
613613
export type { SimpleStringWithPattern } from './models/SimpleStringWithPattern';
614614

615-
export { $_default } from './schemas/$_default';
616615
export { $ArrayWithArray } from './schemas/$ArrayWithArray';
617616
export { $ArrayWithBooleans } from './schemas/$ArrayWithBooleans';
618617
export { $ArrayWithNumbers } from './schemas/$ArrayWithNumbers';
@@ -626,6 +625,7 @@ export { $CommentWithQuotes } from './schemas/$CommentWithQuotes';
626625
export { $CommentWithReservedCharacters } from './schemas/$CommentWithReservedCharacters';
627626
export { $CommentWithSlashes } from './schemas/$CommentWithSlashes';
628627
export { $Date } from './schemas/$Date';
628+
export { $Default } from './schemas/$Default';
629629
export { $DictionaryWithArray } from './schemas/$DictionaryWithArray';
630630
export { $DictionaryWithDictionary } from './schemas/$DictionaryWithDictionary';
631631
export { $DictionaryWithProperties } from './schemas/$DictionaryWithProperties';
@@ -680,18 +680,6 @@ export { TypesService } from './services/TypesService';
680680
"
681681
`;
682682

683-
exports[`v2 should generate: test/generated/v2/models/_default.ts 1`] = `
684-
"/* istanbul ignore file */
685-
/* tslint:disable */
686-
/* eslint-disable */
687-
688-
export type _default = {
689-
name?: string;
690-
};
691-
692-
"
693-
`;
694-
695683
exports[`v2 should generate: test/generated/v2/models/ArrayWithArray.ts 1`] = `
696684
"/* istanbul ignore file */
697685
/* tslint:disable */
@@ -858,6 +846,18 @@ export type Date = string;
858846
"
859847
`;
860848

849+
exports[`v2 should generate: test/generated/v2/models/Default.ts 1`] = `
850+
"/* istanbul ignore file */
851+
/* tslint:disable */
852+
/* eslint-disable */
853+
854+
export type Default = {
855+
name?: string;
856+
};
857+
858+
"
859+
`;
860+
861861
exports[`v2 should generate: test/generated/v2/models/DictionaryWithArray.ts 1`] = `
862862
"/* istanbul ignore file */
863863
/* tslint:disable */
@@ -1469,20 +1469,6 @@ export type SimpleStringWithPattern = string;
14691469
"
14701470
`;
14711471

1472-
exports[`v2 should generate: test/generated/v2/schemas/$_default.ts 1`] = `
1473-
"/* istanbul ignore file */
1474-
/* tslint:disable */
1475-
/* eslint-disable */
1476-
export const $_default = {
1477-
properties: {
1478-
name: {
1479-
type: 'string',
1480-
},
1481-
},
1482-
} as const;
1483-
"
1484-
`;
1485-
14861472
exports[`v2 should generate: test/generated/v2/schemas/$ArrayWithArray.ts 1`] = `
14871473
"/* istanbul ignore file */
14881474
/* tslint:disable */
@@ -1651,6 +1637,20 @@ export const $Date = {
16511637
"
16521638
`;
16531639

1640+
exports[`v2 should generate: test/generated/v2/schemas/$Default.ts 1`] = `
1641+
"/* istanbul ignore file */
1642+
/* tslint:disable */
1643+
/* eslint-disable */
1644+
export const $Default = {
1645+
properties: {
1646+
name: {
1647+
type: 'string',
1648+
},
1649+
},
1650+
} as const;
1651+
"
1652+
`;
1653+
16541654
exports[`v2 should generate: test/generated/v2/schemas/$DictionaryWithArray.ts 1`] = `
16551655
"/* istanbul ignore file */
16561656
/* tslint:disable */

0 commit comments

Comments
 (0)