11import type { Model } from '../../../client/interfaces/Model' ;
22import { getPattern } from '../../../utils/getPattern' ;
3- import { toPascalCase } from '../../../utils/toPascalCase' ;
43import type { OpenApi } from '../interfaces/OpenApi' ;
54import type { OpenApiSchema } from '../interfaces/OpenApiSchema' ;
65import { extendEnum } from './extendEnum' ;
@@ -50,10 +49,10 @@ export const getModel = (
5049 if ( definition . $ref ) {
5150 const definitionRef = getType ( definition . $ref ) ;
5251 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 ;
5554 model . template = definitionRef . template ;
56- model . imports . push ( ...definitionRef . imports . map ( toPascalCase ) ) ;
55+ model . imports . push ( ...definitionRef . imports ) ;
5756 return model ;
5857 }
5958
@@ -73,10 +72,10 @@ export const getModel = (
7372 if ( definition . items . $ref ) {
7473 const arrayItems = getType ( definition . items . $ref ) ;
7574 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 ;
7877 model . template = arrayItems . template ;
79- model . imports . push ( ...arrayItems . imports . map ( toPascalCase ) ) ;
78+ model . imports . push ( ...arrayItems . imports ) ;
8079 return model ;
8180 } else {
8281 const arrayItems = getModel ( openApi , definition . items ) ;
@@ -94,10 +93,10 @@ export const getModel = (
9493 if ( definition . additionalProperties . $ref ) {
9594 const additionalProperties = getType ( definition . additionalProperties . $ref ) ;
9695 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 ;
9998 model . template = additionalProperties . template ;
100- model . imports . push ( ...additionalProperties . imports . map ( toPascalCase ) ) ;
99+ model . imports . push ( ...additionalProperties . imports ) ;
101100 return model ;
102101 } else {
103102 const additionalProperties = getModel ( openApi , definition . additionalProperties ) ;
0 commit comments