[Bug 27498] [ser 3.1]Unfailing serialization

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