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][Spring] OneOf discriminator seems to ignore type format which causes type mismatch #18693

Open
4 of 6 tasks
Kaemmelot opened this issue May 16, 2024 · 0 comments
Open
4 of 6 tasks

Comments

@Kaemmelot
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

OneOf interfaces that should use string+uri as discriminator only use String, which causes a type mismatch because the discriminator is being generated as URI in the classes.

openapi-generator version

7.5.0

OpenAPI declaration file content or url

https://gist.github.com/Kaemmelot/ad720f03f4f536bb0f54ec281e02479d

Generation Details

java -jar openapi-generator-cli-7.5.0.jar generate -i api.yml -g spring

Steps to reproduce

see Gist above, PetResponse has a wrong type for getPetType()

Related issues/PRs

did not find any

Suggest a fix

It could be that the format of the type is not taken into account when generating such a oneOf interface.

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