Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] jaxrs-jersey with useJakartaEe=true JacksonJsonProvider depends on javax.ws.rs.ext.MessageBodyReader #15875

Open
4 of 6 tasks
naude-r opened this issue Jun 19, 2023 · 0 comments

Comments

@naude-r
Copy link

naude-r commented Jun 19, 2023

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

the generated JacksonJsonProvider generated with jaxrs-jersey and useJakartaEe=true does not compile:
JacksonJsonProvider.java:[17,8] cannot access javax.ws.rs.ext.MessageBodyReader class file for javax.ws.rs.ext.MessageBodyReader not found

adding the dependency for javax.ws.rs.ext.MessageBodyReader results in:
Bootstrap.java:[29,51] incompatible types: jakarta.servlet.ServletConfig cannot be converted to javax.servlet.ServletConfig

openapi-generator version

6.6.0 (openapi-generator-maven-plugin)

Generation Details
Steps to reproduce

generate with maven. snippet from pom:

<plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/src/main/resources/example.yaml</inputSpec>
              <generatorName>jaxrs-jersey</generatorName>
              <configOptions>
                <sourceFolder>src/main/java</sourceFolder>
                <dateLibrary>java8</dateLibrary>
                <java8>true</java8>
                <useJakartaEe>true</useJakartaEe>
              </configOptions>
              <modelPackage>com.example.api.model</modelPackage>
              <apiPackage>com.example.api</apiPackage>
            </configuration>
          </execution>
        </executions>
      </plugin>

looks like the generator should import com.fasterxml.jackson.jakarta.rs.json.JacksonXmlBindJsonProvider from jackson-jakarta-rs-json-provider when useJakartaEe=true .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant