Skip to content

Commit

Permalink
add original tag, add dummy model for test
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Sep 2, 2024
1 parent 2428e04 commit 7d2b5de
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ private String getNameUsingParamNaming(String name) {
private String getNameUsingModelPropertyNaming(String name) {
switch (getModelPropertyNaming()) {
case original:
additionalProperties.put("modelPropertyNamingOriginal", true);
return name;
case camelCase:
return camelize(name, LOWERCASE_FIRST_LETTER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export interface {{classname}}{{#allParents}}{{#-first}} extends {{/-first}}{{{.
/** @deprecated */
{{/deprecated}}
{{/description}}
{{^modelPropertyNamingOriginal}}
{{#isReadOnly}}readonly {{/isReadOnly}}{{{name}}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
{{/modelPropertyNamingOriginal}}
{{#modelPropertyNamingOriginal}}
{{#isReadOnly}}readonly {{/isReadOnly}}{{#hasSanitizedName}}'{{{baseName}}}'{{/hasSanitizedName}}{{^hasSanitizedName}}{{{name}}}{{/hasSanitizedName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
{{/modelPropertyNamingOriginal}}
{{/vars}}
}{{>modelGenericEnums}}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ paths:

components:
schemas:
Dummy:
type: object
properties:
property.name:
type: string
DogBreed:
type: string
enum: [Dingo, Husky]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ model/dogBreed.ts
model/dogComposed.ts
model/dogInherited.ts
model/dogMapped.ts
model/dummy.ts
model/models.ts
model/petWithMappedDiscriminator.ts
model/petWithSimpleDiscriminator.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Schemas with different types of composition for testing models generation
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


export interface DummyModel {
'property.name'?: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './dogBreed';
export * from './dogComposed';
export * from './dogInherited';
export * from './dogMapped';
export * from './dummy';
export * from './petWithMappedDiscriminator';
export * from './petWithSimpleDiscriminator';
export * from './petWithoutDiscriminator';

0 comments on commit 7d2b5de

Please sign in to comment.