8000 XML Parsing: Enum as Element Type · Issue #475 · googleapis/google-http-java-client · GitHub
[go: up one dir, main page]

Skip to content
XML Parsing: Enum as Element Type #475
Closed
@geri-m

Description

@geri-m

In the current implementation, an enumeration is only support as XML-Attribut, but not as an Element. We should have enumerations also as elements.

Currently this kind of XMLs/PoJos can be parsed/serialized

<?xml version="1.0"?><any attributeEnum="ENUM_1" xmlns="http://www.w3.org/2005/Atom" />"
  public static class AnyTypeEnumAttributeOnly {
    @Key("@attributeEnum")
    public XmlEnumTest.AnyEnum attributeEnum;
  }`

These XMLs/PoJos causes an exception (no Standard constructor for primitiv type).

<?xml version="1.0"?><any xmlns="http://www.w3.org/2005/Atom"><elementEnum>ENUM_3</elementEnum></any>
  public static class AnyTypeEnumElementOnly {
    @Key
    public XmlEnumTest.AnyEnum elementEnum;
  }

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0