Bug Report Checklist
Description
A schema with two structural identical properties is generated differently with 7.22 and 7.23
Might be related/introduced by #23856
"schema": {
"type": "object",
"properties": {
"abc": {
"type": "object",
"description": "first container",
"properties": {
"result": {
"type": "string",
"description": "ABC Result"
}
}
},
"def": {
"type": "object",
"description": "second container",
"properties": {
"result": {
"type": "string",
"description": "DEF Result"
}
}
}
}
}
7.22 generates basically this class
public class ApiGetDefaultResponse {
private ApiGetDefaultResponseAbc abc;
private ApiGetDefaultResponseDef def;
but 7.23 (or 7.24-snapshot) generates
public class ApiGetDefaultResponse {
private ApiGetDefaultResponseAbc abc;
private ApiGetDefaultResponseAbc def;
Note the field def is of type ApiGetDefaultResponseAbc which breaks code that expects ApiGetDefaultResponseDef
openapi-generator version
7.23 ; with 7.22 it works fine
OpenAPI declaration file content or url
https://raw.githubusercontent.com/pe-st/openapi-generator-deduplicate/refs/heads/main/src/main/resources/openapi.json
Generation Details
https://github.com/pe-st/openapi-generator-deduplicate contains a project with maven plugin configuration and Java code using the generated code, using the JAVA generator
Steps to reproduce
mvn package in the provided reproducer repository fails to compile when using 7.23 instead of 7.22
Related issues/PRs
#23856
Suggest a fix
Bug Report Checklist
Description
A schema with two structural identical properties is generated differently with 7.22 and 7.23
Might be related/introduced by #23856
7.22 generates basically this class
but 7.23 (or 7.24-snapshot) generates
Note the field
defis of typeApiGetDefaultResponseAbcwhich breaks code that expectsApiGetDefaultResponseDefopenapi-generator version
7.23 ; with 7.22 it works fine
OpenAPI declaration file content or url
https://raw.githubusercontent.com/pe-st/openapi-generator-deduplicate/refs/heads/main/src/main/resources/openapi.json
Generation Details
https://github.com/pe-st/openapi-generator-deduplicate contains a project with maven plugin configuration and Java code using the generated code, using the JAVA generator
Steps to reproduce
mvn packagein the provided reproducer repository fails to compile when using 7.23 instead of 7.22Related issues/PRs
#23856
Suggest a fix