Skip to content

Option to omit default fields in serialized lists and arrays #39

@mvglasow

Description

@mvglasow

When serializing a list with @ElementList or an array with @ElementArray, SimpleXML always seems to add an extra attribute, class for lists and length for arrays.

By using a custom TreeStrategy, I can change the attribute names but I cannot suppress the attributes altogether. (For @ElementList there is a hack by inlining the list and specifying @Path, but that is somewhat complicated and does not work for arrays.)

It would be great if there were an easy, standard way to suppress these attributes during serialization. Maybe with a separate field for the annotation (per element) or a new Strategy (which would take effect globally).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions