-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Open
Labels
Description
Bug Report Checklist
- [✅] Have you provided a full/minimal spec to reproduce the issue?
- [✅] Have you validated the input using an OpenAPI validator?
- [❌: I couldn't build the latest Snapshot due to proxy and corporate restrictions] Have you tested with the latest master to confirm the issue still exists?
- [✅] Have you searched for related issues/PRs?
- [expected: should not result in compile errors] What's the actual output vs expected output?
- [❌] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Using the attached files will result in a non compiling generated client, as seen in the description of Steps to reproduce. This is the minimal example I could create. The actual use-case we have is, to use the attached ApiError class in a ControllerAdvice to react to errors of our services.
openapi-generator version
7.17.0
OpenAPI declaration file content or url
https://gist.github.com/coinzz/24597c69a8877d95e4f10fd681f28ee3
Generation Details
- Apache Maven 3.9.9
- openjdk 17.0.12 2024-07-16 LTS
- also with: openjdk 21.0.4 2024-07-16 LTS
- the rest is configured in the pom.xml
Steps to reproduce
- Put the api-docs.json on the same level as the pom.xml
- run
mvn generate-sources - This will be succesful, but navigate to
generated-sources\client\src\main\java\de\test\client\model\HttpStatus.java - See the Error:

Related issues/PRs
I couldn't find a direct related issue.
Suggest a fix
It seems that sealed classes or inheritance break the generation, but I am not sure if that is the concrete problem.