Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1407

JSON encoding of number changes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.2
    • HTTP Interface
    • None
    • Ubuntu 12.04 (alpha)

    Description

      JSON encoding of Number has changed from 1.0.2 to 1.2. JSON only defines Number but this change causes issues in my app because python decodes the number as an int in 1.2.

      Test case:

      PORT=5985

      curl -X DELETE http://localhost:$PORT/test-floats/
      curl -X PUT http://localhost:$PORT/test-floats/

      curl -X PUT http://localhost:$PORT/test-floats/doc1 -H "Content-Type: application/json" -d "

      { \"a\": 1.0 }

      "
      curl http://localhost:$PORT/test-floats/doc1

      Run against 1.0.2:

      {"ok":true} {"ok":true} {"ok":true,"id":"doc1","rev":"1-78e61304147429d3d500aee7806fd26d"} {"_id":"doc1","_rev":"1-78e61304147429d3d500aee7806fd26d","a":1.0}

      Run against 1.2:

      {"ok":true} {"ok":true} {"ok":true,"id":"doc1","rev":"1-78e61304147429d3d500aee7806fd26d"} {"_id":"doc1","_rev":"1-78e61304147429d3d500aee7806fd26d","a":1}

      Attachments

        1. 0001-Only-validate-numbers-on-JSON-decoding.patch
          6 kB
          Filipe David Borba Manana

        Activity

          People

            Unassigned Unassigned
            adamlofts Adam Lofts
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: