quarkiverse / quarkus-openapi-generator

OpenAPI Generator - REST Client Generator
Apache License 2.0
125 stars 88 forks source link

Cannot find symbol "NOT_FOUND.class" #852

Closed david-cabillic closed 2 days ago

david-cabillic commented 2 weeks ago

During generation with 2.6.0-lts (or 2.5.0) from an Open API JSON file, a NOT_FOUND.class is included in annotations but not imported :

@com.fasterxml.jackson.annotation.JsonSubTypes({
    @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = NOT_FOUND.class, name = "ArchivalAutoFillExpansion"),
    @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = NOT_FOUND.class, name = "ReindexAutoFillExpansion"),
    @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = NOT_FOUND.class, name = "ArchivalAutoFillExpansionModifierProperties"),
    @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = NOT_FOUND.class, name = "ReindexAutoFillExpansionModifierProperties"),
})

It was working with 2.4.7.

ricardozanini commented 2 weeks ago

Hi! Thanks for reporting it, but we will need more info.

Can you please share a reproducer?

david-cabillic commented 1 week ago

Hi,

It's not easy to provide a reproducer cause I have few time and my code is in a custom company framework. This is my config :

pom.xml

<properties>
        <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
        <quarkus.platform.version>3.16.2</quarkus.platform.version>
        <quarkus-maven-plugin.version>3.16.2</quarkus-maven-plugin.version>
</properties>
<dependencies>
        <dependency>
            <groupId>io.quarkiverse.openapi.generator</groupId>
            <artifactId>quarkus-openapi-generator</artifactId>
            <version>2.6.0-lts</version>
        </dependency>
</dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>io.smallrye</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>3.1.6</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

src/main/resources/application.properties

quarkus.openapi-generator.codegen.enable-security-generation=false
quarkus.openapi-generator.codegen.spec.administration_json.base-package=ch.tcs.onbase.administration
quarkus.openapi-generator.codegen.spec.administration_json.config-key=obadministration
quarkus.openapi-generator.codegen.spec.administration_json.additional-api-type-annotations=@org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders(ch.tcs.onbase.header.AuthHeadersFactory.class)
quarkus.openapi-generator.codegen.spec.administration_json.model-name-prefix=OB

src/main/openapi/administration.json

ricardozanini commented 1 week ago

@david-cabillic can't you share the OpenAPI file?

EDIT: sorry, I see that you uploaded in the link. I'll take a look.

david-cabillic commented 1 week ago

@ricardozanini Maybe you should activate security and remove 'quarkus.openapi-generator.codegen.spec.administration_json.additional-api-type-annotations'.