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] Generated Java code is importing javax.ws.rs.core.GenericType which doesn't exist #13692

Closed
kwalcock opened this issue Oct 14, 2022 · 4 comments

Comments

@kwalcock
Copy link

Bug Report Checklist

  • [no] Have you provided a full/minimal spec to reproduce the issue?
  • [yes] Have you validated the input using an OpenAPI validator (example)?
  • [no] Have you tested with the latest master to confirm the issue still exists?
  • [yes] Have you searched for related issues/PRs?
  • [?] What's the actual output vs expected output?
  • [no] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The generated Java code includes

import javax.ws.rs.core.GenericType;

which doesn't compile.

openapi-generator version

openapi-generator-cli-6.2.0.jar

OpenAPI declaration file content or url
Generation Details

java -jar openapi-generator-cli-6.2.0.jar generate -i (input) -g java -o (output)

Steps to reproduce

Java 8.0 is being used locally.

Related issues/PRs
Suggest a fix
@kwalcock
Copy link
Author

  "javax.ws.rs" % "jsr311-api" % "1.1.1",
  "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1",

@sylvaindd
Copy link

Same issue for me with 6.2.1 :

<execution>
  <id>client</id>
  <goals>
    <goal>generate</goal>
  </goals>
  <configuration>
    <inputSpec>${project.basedir}/src/main/resources/recordyaml</inputSpec>
    <generatorName>java</generatorName>
    <modelPackage>fr.model</modelPackage>
    <apiPackage>fr.api</apiPackage>
    <configOptions>
      <errorObjectType>fr.model.MediarecordResult</errorObjectType>
      <useJakartaEe>true</useJakartaEe>
      <sourceFolder>src/gen/java/main</sourceFolder>
    </configOptions>
  </configuration>
</execution>`

@jakeswenson
Copy link

I'm seeing the same issue with the 6.6.0 maven open api generator...
The only change was to upgrade my generator version from a very old version to the latest (4.3.1 to 6.6.0.)

I believe i've narrowed this down to #11538 this line

Interesting enough i see another PR #9585 was done for 5.2.0 to remove this dependency, but some how it made it back in the okhttp-gson-nextgen PR (#11538) - i wonder if this was just a merge issue for this work?

Is the "solution" really to just add a dependency on javax.ws.rs to resolve this for now??

@jakeswenson
Copy link

Oh sweet, this looks to have been fixed in 7.0.0 by #15896 - thanks to @bcalvez!

@wing328 wing328 closed this as completed Sep 6, 2023
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

4 participants