Support BsonDiscriminator for records

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Codecs, POJO
    • None
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      The driver supports the BsonDiscriminator annotation on POJOs, but doesn't do the same for Java records. This makes a certain amount of sense since records are not allowed to extend a base record like a POJO can for a base class. But records can implement common interfaces, so it does still make sense to discriminate between different record types that implement a common interface and are stored in the same collection.

        1. OneofDiscriminator.java
          2 kB
        2. OneofDiscriminatorCodec.java
          11 kB

              Assignee:
              Unassigned
              Reporter:
              Jeffrey Yemin
              None
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: