Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5484

Consider support for @SerialName annotation to simplify writing refactoring-safe queries

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Java Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      (Copying this over from a feedback.mongodb.com request) –

      I'm talking about the kotlin-driver (there was no kotlin selectable in the dropdown, so I chose "Java" since the kotlin driver is based on the java driver).

      When using the kotlin-driver with kotlinx.serialization it's a bit complicated to write refactoring-safe queries, because when using the KProperty.name reference like in the examples of the documentation a possible @SerialName annotation is not considered.

      I'd like an API matching what KMongo provided that you can just reference the KProperty, and the driver under the hood decides whether to choose just the name or the value of a possible SerialName annotation.

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            ashni.mehta@mongodb.com Ashni Mehta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: