Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-85299

QCborValue::toJsonValue() documentation is vague about QByteArray

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.1
    • 5.15.0
    • Core: Other
    • None
    • All
    • 0d55d1c640eff6b1bb9fcfa8f9130635782e0c97 (qt/qtbase/dev) 764205577b5464ed01cc66bded9743dd59531217 (qt/qtbase/5.15)

    Description

      From: https://doc.qt.io/qt-5/qcborvalue.html#toJsonValue

       

      It appears that ANY QByteArray data ends up base64 encoded (even simple strings like "hello").  The documentation makes it sound like it's lossless, which it is, but use of that word, coupled with the "an encoding like base64" is vague and makes the reader think if they put in simple ascii "hello" they get back "hello" and not some crazy "qq1234qw" base64 string.

       

      Suggest making the documentation for QCBorValue more explicit as well as the QJsonDocument documentation to tell users what to expect if they stick QByteArrays into their QCBors or QVariants and then serialize to JSON. Going from "hello" -> crazy base64 string is not what most developers would expect.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            cculianu calin culianu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes