Skip to content

JAXBElement is not marshalled as root element #1233

Open
@lcintrat

Description

@lcintrat

Hi,

When a JAXBElement is used as root element of a response entity, JaxbConverter is not selected.
This case may happen when returning XML simple type (excerpt from my ObjectFactory):

    @XmlElementDecl(namespace = "http://www.example.org/xml", name = "URI")
    public JAXBElement<String> createURI(String value) {
        return new JAXBElement<String>(_URI_QNAME, String.class, null, value);
    }

org.restlet.resource.Resource.toRepresentation(Object source, Variant target) returns null, because org.restlet.ext.jaxb.JaxbConverter.score(Object, Variant, Resource) only checks for JaxbRepresentation or XmlRootElement source.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions