You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The generator does not generate classes correctly when there are referenced components with the same name but one of them starts with lowercase and the other one with uppercase.
paths:
/cat/{catId}:
get:
operationId: getCatdescription: Gets a catparameters:
- in: pathname: catIddescription: Id of the catschema:
type: integerrequired: trueresponses:
'200':
description: 'OK'content:
application/json:
schema:
$ref: 'cat.yaml#/components/schemas/Cat'/dog/{dogId}:
get:
operationId: getDogdescription: Gets a dogparameters:
- in: pathname: dogIddescription: Id of the dogschema:
type: integerrequired: trueresponses:
'200':
description: 'OK'content:
application/json:
schema:
$ref: 'dog.yaml#/components/schemas/Dog'
When we run the generate-sources for pet-shop.yaml only one SoundDto.java enum is generated - the one that starts with lowercase and cosequently the DogDto contains an enum [MEOUW, MRRR].
If both enums are called Sound or sound, then the generator correctly generates two enums - SoundDto and Sound1Dto, but when one starts with lowercase and the other with uppercase, the lowercase takes precedence and as a result the Dog object gets an incorrect type for it's sound property.
The expected behavior is that the generator recognizes these are two different types and generates two different classes
openapi-generator version
7.11.0 but is also reproducible with earlier versions (6.6.0). Last known version that worked was 4.3.1 but there might be more versions that worked between 4.3.1 and 6.6.0
Steps to reproduce
Attached is the example project, it can be reproduced by running maven
Bug Report Checklist
Description
The generator does not generate classes correctly when there are referenced components with the same name but one of them starts with lowercase and the other one with uppercase.
Here is an example
cat.yaml
dog.yaml
pet-shop.yaml
When we run the generate-sources for pet-shop.yaml only one SoundDto.java enum is generated - the one that starts with lowercase and cosequently the DogDto contains an enum [MEOUW, MRRR].
If both enums are called Sound or sound, then the generator correctly generates two enums - SoundDto and Sound1Dto, but when one starts with lowercase and the other with uppercase, the lowercase takes precedence and as a result the Dog object gets an incorrect type for it's sound property.
The expected behavior is that the generator recognizes these are two different types and generates two different classes
openapi-generator version
7.11.0 but is also reproducible with earlier versions (6.6.0). Last known version that worked was 4.3.1 but there might be more versions that worked between 4.3.1 and 6.6.0
Steps to reproduce
Attached is the example project, it can be reproduced by running maven
pet-shop.zip
The text was updated successfully, but these errors were encountered: