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] [JAVA] okhttp-gson joda client codegen ambiguous references for LocalDate and DateTimeFormatter #18416

Open
2 of 6 tasks
UnstoppableN opened this issue Apr 17, 2024 · 1 comment

Comments

@UnstoppableN
Copy link

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

I'm trying to generate java client code with the default library template "okhttp-gson" and date library "joda".
The generated code has compile issues:

ApiClient.java:[337,39] error: reference to DateTimeFormatter is ambiguous both class org.joda.time.format.DateTimeFormatter in org.joda.time.format and class java.time.format.DateTimeFormatter in java.time.format match
and
JSON.java:[289,65] error: reference to LocalDate is ambiguous both class org.joda.time.LocalDate in org.joda.time and class java.time.LocalDate in java.time match

openapi-generator version

7.5.0

Suggest a fix

I believe the issue was introduced with commit: 8455c1c
It would be fixed if java.time.format.DateTimeFormatter and java.time.LocalDate are not included in the ApiClient.mustache and the JSON.mustache

@wing328
Copy link
Member

wing328 commented Apr 18, 2024

It would be fixed if java.time.format.DateTimeFormatter and java.time.LocalDate are not included in the ApiClient.mustache and the JSON.mustache

do you mind filing a PR with the suggested fix when you've time?

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

2 participants