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

Keys within extended JSON should not require quotation marks

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.7.0
    • Affects Version/s: 3.5.0
    • Component/s: JSON
    • None
    • Fully Compatible
    • Not Needed

      A JSON document like

      {
         operationTime : {$timestamp : {t : 40, i : 20}
      }
      

      should parse even though the "t" and "i" fields are unquoted. In 3.5 it throws an exception:

      org.bson.json.JsonParseException: JSON reader expected a string but found 't'.
      
      	at org.bson.json.JsonReader.readStringFromExtendedJson(JsonReader.java:1126)
      	at org.bson.json.JsonReader.visitTimestampExtendedJson(JsonReader.java:1146)
      	at org.bson.json.JsonReader.visitExtendedJSON(JsonReader.java:626)
      	at org.bson.json.JsonReader.readBsonType(JsonReader.java:148
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: