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: bring back discriminator initialization to where it was before #773

Merged
merged 1 commit into from
Nov 2, 2020
Merged

fix: bring back discriminator initialization to where it was before #773

merged 1 commit into from
Nov 2, 2020

Conversation

kaibra
Copy link
Contributor

@kaibra kaibra commented Oct 9, 2020

PR: #620 , which was introduced in 1.0.19, seems to be causing multiple issues (eg #654).

This PR aims at fixing two issues:
fixes #686
fixes swagger-api/swagger-codegen#10198

Both issues are about missing polymorphic jackson annotations (JsonSubTypes, JsonTypeInfo).

The issue was caused by moving the initialization of the discriminator into the ComposedSchema block (5d22382#diff-371437d4e9e09ea18f2ff29dbacd0e84L1279).

In the examples mentioned in the issues, the model is not a ComposedSchema.
But the discriminator needs to be initialized for the annotations to be generated, but it is only for ComposedSchemas now.

This PR moves the initialization back to where it was before.
I am not quite sure if this has other side-effects, I did not see. It looks like there are a bunch of cases untested?!
Still I hope this might speed up things in case it gets approved.

Cheers,

Kai

@asauray
Copy link

asauray commented Oct 15, 2020

This 👍

I hope somebody can review it soon

@asauray
Copy link

asauray commented Nov 2, 2020

@HugoMario Could you take a look ? It seems you have worked on a related issue earlier last summer.

@HugoMario HugoMario self-assigned this Nov 2, 2020
@HugoMario HugoMario added this to the M10 milestone Nov 2, 2020
@HugoMario HugoMario merged commit 93d018c into swagger-api:master Nov 2, 2020
@HugoMario
Copy link
Contributor

thanks a lot @kaibra for this PR!!!

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