@BsonProperty on a getter is ignored if the field is not serialized anyway

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.10.2
    • Component/s: POJO
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If I have a getter/setter pair like
      public long get07()
      and
      public void set07(long _07)
      I don't see any way to make these serialize and deserialize using the POJO support.
      Adding @BsonProperty("07") has no effect at all and the field is simply ignored completely.
      The only way I found was to add another pair of getter/setter that has some name that is recognized as property and then use the annotation to configure the name.

      Imho adding the annotation to a paramterless getter should be enough to make it serialize.

            Assignee:
            Unassigned
            Reporter:
            Björn Kautler
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: