1
1
import type { Model } from '../../../client/interfaces/Model' ;
2
2
import { getPattern } from '../../../utils/getPattern' ;
3
- import { toPascalCase } from '../../../utils/toPascalCase' ;
4
3
import type { OpenApi } from '../interfaces/OpenApi' ;
5
4
import type { OpenApiSchema } from '../interfaces/OpenApiSchema' ;
6
5
import { extendEnum } from './extendEnum' ;
@@ -50,10 +49,10 @@ export const getModel = (
50
49
if ( definition . $ref ) {
51
50
const definitionRef = getType ( definition . $ref ) ;
52
51
model . export = 'reference' ;
53
- model . type = toPascalCase ( definitionRef . type ) ;
54
- model . base = toPascalCase ( definitionRef . base ) ;
52
+ model . type = definitionRef . type ;
53
+ model . base = definitionRef . base ;
55
54
model . template = definitionRef . template ;
56
- model . imports . push ( ...definitionRef . imports . map ( toPascalCase ) ) ;
55
+ model . imports . push ( ...definitionRef . imports ) ;
57
56
return model ;
58
57
}
59
58
@@ -73,10 +72,10 @@ export const getModel = (
73
72
if ( definition . items . $ref ) {
74
73
const arrayItems = getType ( definition . items . $ref ) ;
75
74
model . export = 'array' ;
76
- model . type = toPascalCase ( arrayItems . type ) ;
77
- model . base = toPascalCase ( arrayItems . base ) ;
75
+ model . type = arrayItems . type ;
76
+ model . base = arrayItems . base ;
78
77
model . template = arrayItems . template ;
79
- model . imports . push ( ...arrayItems . imports . map ( toPascalCase ) ) ;
78
+ model . imports . push ( ...arrayItems . imports ) ;
80
79
return model ;
81
80
} else {
82
81
const arrayItems = getModel ( openApi , definition . items ) ;
@@ -94,10 +93,10 @@ export const getModel = (
94
93
if ( definition . additionalProperties . $ref ) {
95
94
const additionalProperties = getType ( definition . additionalProperties . $ref ) ;
96
95
model . export = 'dictionary' ;
97
- model . type = toPascalCase ( additionalProperties . type ) ;
98
- model . base = toPascalCase ( additionalProperties . base ) ;
96
+ model . type = additionalProperties . type ;
97
+ model . base = additionalProperties . base ;
99
98
model . template = additionalProperties . template ;
100
- model . imports . push ( ...additionalProperties . imports . map ( toPascalCase ) ) ;
99
+ model . imports . push ( ...additionalProperties . imports ) ;
101
100
return model ;
102
101
} else {
103
102
const additionalProperties = getModel ( openApi , definition . additionalProperties ) ;
0 commit comments