Skip to content

JSON Serialization: Sequences on Top Level #1471

@ChristianGruen

Description

@ChristianGruen

Extracted from #576:

All serialization methods except for json allow sequences to be output on top level. We should also allow this for JSON data. This way, constructs like…

declare option output:item-separator '
';
declare option output:method 'text';

for $json in ({ 1: 2 }, { 3: 4 })
return serialize($json, { 'method': 'json' })

…can be simplified to:

declare option output:method 'json';
{ 1: 2 },
{ 3: 4 }

We should still not allow sequences within JSON structures. It would be inconsistent to have different output rules depending on the number of items in a sequence ((1) and [1] would not be serialized identically).

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementA change or improvement to an existing featureSerializationAn issue related to the Serialization spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions