OpenAPITools / OpenAPITools/openapi-generator

[BUG][java-helidon-server] generated code does not compile: interface expected here

Open
#21,883 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • 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

i am trying to generate the server stubs for this yaml file:
https://github.com/simPod/GrafanaJsonDatasource/blob/0.6.x/openapi.yaml

using this maven code:

            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>7.15.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/GrafanaJsonDatasource/openapi.yaml</inputSpec>
                            <generatorName>java-helidon-server</generatorName>
                            <library>mp</library>
                            <packageName>simPod.grafanaJsonDatasource.helidon</packageName>
                            <modelPackage>simPod.grafanaJsonDatasource.model</modelPackage>
                            <apiPackage>simPod.grafanaJsonDatasource.api</apiPackage>
                            <invokerPackage>simPod.grafanaJsonDatasource.invoker</invokerPackage>
                            <configOptions>
                                <!-- docs here: https://helidon.io/docs/v4/mp/openapi/openapi-generator -->
                                <fullProject>false</fullProject>
                                <disallowAdditionalPropertiesIfNotPresent>false</disallowAdditionalPropertiesIfNotPresent>
                                <enumUnknownDefaultCase>true</enumUnknownDefaultCase>
                                <legacyDiscriminatorBehavior>false</legacyDiscriminatorBehavior>
                                <useAbstractClass>true</useAbstractClass>
                                <useOneOfInterfaces>true</useOneOfInterfaces>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

but when i try and run: mvn compile

it gives me this error:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /.../target/generated-sources/openapi/src/main/java/simPod/grafanaJsonDatasource/model/Dataframe.java:[29,36] interface expected here
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.264 s
[INFO] Finished at: 2025-09-03T18:52:48+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project XXX: Compilation failure
[ERROR] /.../target/generated-sources/openapi/src/main/java/simPod/grafanaJsonDatasource/model/Dataframe.java:[29,36] interface expected here

the 2 generated files causing the issue are:

package simPod.grafanaJsonDatasource.model;
...
public class Dataframe  implements ApiEndpointsVariable200Response {

Dataframe.java
but ApiEndpointsVariable200Response just a class:

package simPod.grafanaJsonDatasource.model;
...
public class ApiEndpointsVariable200Response  {

ApiEndpointsVariable200Response.java

@spericas @tjquinno @tvallin

openapi-generator version

7.15.0, (currently the latest version)

OpenAPI declaration file content or url

https://github.com/simPod/GrafanaJsonDatasource/blob/0.6.x/openapi.yaml

Generation Details

java/helidon/maven

Steps to reproduce
  • create a simple Helidon MP project,
  • add yaml file
  • and maven snippet to from description
  • try to compile project
Related issues/PRs
Suggest a fix

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the linked openapi.yaml, the java-helidon-server Maven configuration, and mvn compile. Start by comparing the generated Dataframe.java and ApiEndpointsVariable200Response.java declarations; done means the generated sources compile without the interface error, with coverage for this specification or configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.