[JAVA-5318] Java RecordCodec not supporting "BsonDiscriminator" Created: 04/Feb/24  Updated: 05/Feb/24

Status: Backlog
Project: Java Driver
Component/s: BSON, Codecs
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Eli Partsi Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Java Drivers

 Description   

Java Record supports for interface implementation.

Let say i have interface A

record B implements A

record C implements A

Let say i have some type of collection like this: List<A>

This list permit me to add B and C types of objects.

The problem is when you try to convert this list to BSON using RecordCodec

It throws Not supporting exception for BsonDiscriminator.

BsonDiscriminator supporting records is essential for this situation otherwise it is requiring to manually implement this solution...

Full Explanation



 Comments   
Comment by PM Bot [ 04/Feb/24 ]

Hi eliparchik@gmail.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 09:04:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.