[JAVA-4826] BsonRepresentation annotation to be used with generics Lists & Maps Created: 02/Dec/22 Updated: 09/Oct/23 |
|
| Status: | Backlog |
| Project: | Java Driver |
| Component/s: | POJO |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andrea Santi | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 7 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Quarter: | FY24Q4 |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
|
Motivation: JAVA-3677 Introduced the use of BsonRepresentation annotation in order to have clean PoJo. That was a nice improvement. The current annotation cannot be used however in List & Maps: i.e. is not possible to have something like this:
This is mainly because the current annotation target is the following
It would be nice to have also as target TYPE_USE (e.g. thishttps://javaee.github.io/javaee-spec/javadocs/index.html?javax/validation/constraints/package-summary.html annotation can be used in type arguments of List and Map.
In the C# driver this support is available: we have the DictionaryRepresentationhttps://mongodb.github.io/mongo-csharp-driver/1.11/serialization/ annotation
|
| Comments |
| Comment by Ashni Mehta [ 12/Dec/22 ] |
|
Hi Andrea, thank you for filing this feature request, and for the feedback on https://jira.mongodb.org/browse/JAVA-3677. We'll be taking this into consideration for an upcoming release. However, it may be some time before we are able to get to it due to existing commitments and priorities. We are happy to accept contributions to help improve the driver, if you'd be interested in submitting a pull request and possibly collaborating on some of this work. |