Bug Report Checklist
Description
OpenAPIGenerator v7.0.1 and v6.6.0 is unable to generate a child class's constructor that could be constructed successfully with v6.0.1
We were using this .yaml snippet to define a response type:
ListTimesheetsResponse:
description: The response for listing timesheets
allOf:
- $ref: '#/components/schemas/SuccessPagingResponseV1'
- type: object
description: |
The list of timesheets
properties:
data:
type: array
items:
$ref: '#/components/schemas/Timesheet'
using v7.0.1 and v6.6.0 generated code as such:
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2023-10-11T21:11:03.837084888Z[Etc/UTC]")
public class ListTimesheetsResponse extends SuccessPagingResponseV1 {
@Valid
private List<@Valid Timesheet> data;
public ListTimesheetsResponse() {
super();
}
/**
* Constructor with only required parameters
*/
public ListTimesheetsResponse(String responseType, Boolean success) {
super(pageInfo, responseType, success);
}
As shown in the code, the pageInfo variable used in the constructor is neither defined nor passed in as a parameter anywhere.
While using v6.0.1 generates the valid code.
openapi-generator version
v7.0.1 and v6.6.0
OpenAPI declaration file content or url
included in description
This is the definition of the parent class for reference:
SuccessPagingResponseV1:
description: |
Another base success response
allOf:
- $ref: '#/components/schemas/SuccessResponseV1'
properties:
pageInfo:
description: Information on the page of data contained in the response.
$ref: '#/components/schemas/ResponsePagingInfoV1'
required:
- pageInfo
Generation Details
Steps to reproduce
Set up the repository and simply run mvn clean install, such error would be prompted:
[ERROR] /Users/tegee/talech/git/microservices/ts_service/target/generated-sources/src/main/java/com/talech/platform/microservicecommons/controller/dto/ListTimesheetsResponse.java:[46,10] error: pageInfo has private access in SuccessPagingResponseV1
Related issues/PRs
Suggest a fix
Bug Report Checklist
Description
OpenAPIGenerator v7.0.1 and v6.6.0 is unable to generate a child class's constructor that could be constructed successfully with v6.0.1
We were using this .yaml snippet to define a response type:
using v7.0.1 and v6.6.0 generated code as such:
As shown in the code, the pageInfo variable used in the constructor is neither defined nor passed in as a parameter anywhere.
While using v6.0.1 generates the valid code.
openapi-generator version
v7.0.1 and v6.6.0
OpenAPI declaration file content or url
included in description
This is the definition of the parent class for reference:
Generation Details
Steps to reproduce
Set up the repository and simply run
mvn clean install, such error would be prompted:[ERROR] /Users/tegee/talech/git/microservices/ts_service/target/generated-sources/src/main/java/com/talech/platform/microservicecommons/controller/dto/ListTimesheetsResponse.java:[46,10] error: pageInfo has private access in SuccessPagingResponseV1Related issues/PRs
Suggest a fix