Skip to content

XML Deserialization: single-element collections not handled as lists #16

@naferok

Description

@naferok

Description
When deserializing XML in XmlFormatDeserializer, if type.isCollection is true but the XML contains a single element (e.g., <rows><row>...</row></rows>), the result is an XmlParsedMap instead of an XmlParsedList. This breaks schema expectations requiring a collection.

Image

Current result:

  • Multiple elements return an XmlParsedList.
  • A single returns an XmlParsedMap.

Expected Result

Always return an XmlParsedList when type.isCollection is true, even for a single element

Test case
https://gist.github.com/naferok/57419d93707e2728d4fcc763f597af62

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions