Skip to content

More than one field has the JSON key item. #165

Closed
@fatherchill

Description

@fatherchill

Unsure if this is a new feature or just a case of not understanding how to use it correctly.

I use xml2json to convert an xml into Google Data json. A 'section' has one or more 'item' children. If there is only one, it becomes an Object property. If there are multiple, an Array.

Currently I have: @jsonkey(name: "item", nullable: true)
final List items;

But it throws an error when encountering an item Object.

Is there any way to ensure that a single Item Object will get serialized into a , or is there another way of handling this?

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