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 JAVA-5764 #1610

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

fix JAVA-5764 #1610

wants to merge 5 commits into from

Conversation

raffaeleflorio
Copy link

@raffaeleflorio raffaeleflorio commented Jan 16, 2025

This PR is about the JAVA-5764 issue. It changes the encode method by skipping the encode of a property if it's already encoded as the discriminator.

@rozza
Copy link
Member

rozza commented Jan 22, 2025

@raffaeleflorio could you include a test case for the issue?

@raffaeleflorio
Copy link
Author

raffaeleflorio commented Jan 22, 2025

@rozza I've just added the test case. The testDiscriminatorEncodedOnceWhenItIsAlsoAGetter fails without the change because the discriminator will be encoded two times instead of one when encoding a DiscriminatorWithModelGetter object.

@raffaeleflorio
Copy link
Author

raffaeleflorio commented Jan 23, 2025

@rozza I also added the testDiscriminatorEncodedOnceWhenItIsAlsoAProperty in order to test a getter with the readName as the discriminationKey. It fails without the fix because the same reasons of the aforesaid test.

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

Successfully merging this pull request may close these issues.

3 participants