mongo-java-driver icon indicating copy to clipboard operation
mongo-java-driver copied to clipboard

fix JAVA-5764

Open raffaeleflorio opened this issue 1 year ago • 4 comments

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.

raffaeleflorio avatar Jan 16 '25 17:01 raffaeleflorio

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

rozza avatar Jan 22 '25 10:01 rozza

@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 avatar Jan 22 '25 11:01 raffaeleflorio

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

raffaeleflorio avatar Jan 23 '25 06:01 raffaeleflorio

Hello @rozza @jyemin, what else could I improve about this PR? Thanks

raffaeleflorio avatar Apr 10 '25 07:04 raffaeleflorio

Assigned vbabanin for team dbx-java because rozza is out of office.

Looks good - just going to run the CI again then should be able to merge.

Thanks @raffaeleflorio

rozza avatar Sep 03 '25 13:09 rozza