W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2015

[Bug 27498] [ser 3.1]Unfailing serialization

From: <bugzilla@jessica.w3.org>
Date: Wed, 21 Jan 2015 14:50:10 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-27498-523-xU168Qzzlt@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27498

Christian Gruen <christian.gruen@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #13 from Christian Gruen <christian.gruen@gmail.com> ---
One more detail: The working draft states that

  An array item or a map item is serialized using the JSON output method
  described in 9 JSON Output Method, with the following amendments to the
  JSON serialization rules:

  * A sequence of length greater than one in the data model instance will be
    serialized using the Adaptive output method rather than raising a
    serialization error [err:SERE0023].

As a consequence, sequences with a single item will be serialized differently
outside and inside maps/arrays:

* true#0  →  true#0
* [ true#0 ]  →  error/implementation-defined fallback
* [ (true#0, false#0) ]  →  [ true#0 false#0 ]
* map { 'x': true#0 }  →  error/implementation-defined fallback
* map { 'x': (true#0, false#0) }  →  { "x": true#0 false#0 }

My advice would be to simplify the first rule to:

  * Members of arrays and values of maps will be serialized using the
    Adaptive output method.

The serialized results would then be:

* true#0  →  true#0
* [ true#0 ]  →  [ true#0 ]
* [ (true#0, false#0) ]  →  [ true#0 false#0 ]
* map { 'x': true#0 }  →  { "x": true#0 }
* map { 'x': (true#0, false#0) }  →  { "x": true#0 false#0 }

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Wednesday, 21 January 2015 14:50:12 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 21 January 2015 14:50:13 UTC