Closed
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
While using java 17 and openapi-generator-maven-plugin with version 7.10.0 there is a compilation error while using allOf.
Example:
openapi: '3.0.3'
info:
version: '2.0'
paths: {}
components:
schemas:
ExamplesCreateRequest:
type: 'object'
properties:
examples:
type: 'array'
items:
$ref: './ExampleCreateRequest.yaml#/components/schemas/ExampleCreateRequest'
description: 'List of examples to create.'
required:
- 'examples'
and ExampleCreateRequest is next:
openapi: '3.0.3'
info:
version: '2.0'
paths: {}
components:
schemas:
ExampleCreateRequest:
type: 'object'
allOf:
- $ref: './Example.yaml#/components/schemas/Example'
the next java code was generated
public ExamplesCreateRequest addExamplesItem(Example examplesItem) {
if (this.examples == null) {
this.examples = new ArrayList<>();
}
this.examples.add(examplesItem); <--- Compilation error
return this;
}