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

Fix for allOf discriminator issue breaks oneOf discriminator generation #654

Closed
trohrberg opened this issue Apr 20, 2020 · 1 comment
Closed

Comments

@trohrberg
Copy link

A couple of days ago, I realized that my project using the Swagger Codegen does not work anymore when using the current release version of Swagger Codegen. The problem is that, for a oneOf discriminator mapping, the corresponding Type-Info-Annotation is now missing in the POJO model classes:

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "typ", visible = true )
@JsonSubTypes({
}}

After investigating the issue further, I realized that the changes for PR #620 introduced a change which breaks that part of the code generation. Thus, I am able to provide a PR to fix that problem shortly.

trohrberg pushed a commit to trohrberg/swagger-codegen-generators that referenced this issue Apr 20, 2020
…tly.

With the changes of PR swagger-api#620, the generation of the Type-Info-Annotation for the POJO model classes is broken in case there is a oneOf discriminator mapping in the OpenAPI model. This commit re-introduces the correct generation for those annotation.

(cherry picked from commit 3149424c1ea1fbe7447266aeb9b91a1306380900)
HugoMario added a commit that referenced this issue Jun 19, 2020
Fix issue #654: Set discriminator for oneOf mapping correctly.
@HugoMario
Copy link
Contributor

fixed wth #773

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

No branches or pull requests

2 participants