eclipse / lyo

Eclipse Lyo, a Java SDK for OSLC-based tool integration
https://oslc.github.io/developing-oslc-applications/eclipse_lyo/eclipse-lyo.html
Eclipse Public License 2.0
13 stars 16 forks source link

OslcXmlProvider / OslcRdfXmlProvider always returns true for method "isReadable" #226

Open jhemm2 opened 2 years ago

jhemm2 commented 2 years ago

In the OslcRdfXmlProvider hence also in the OslcXmlProvider the isReadable method always returns true. This makes it impossible to use another XML Messagebody reader.

isReadable method should be implemented correctly, e.g.:

`    @Override
    public boolean isReadable(final Class<?> type, final Type genericType, final Annotation[] annotations,
            final MediaType mediaType) {
        return isReadable(type, mediaType, OslcMediaType.APPLICATION_RDF_XML_TYPE, OslcMediaType.APPLICATION_XML_TYPE,
                OslcMediaType.TEXT_XML_TYPE, OslcMediaType.TEXT_TURTLE_TYPE);
    }`
berezovskyi commented 2 years ago

Thank you for your report, @jhemm2, and a suggested fix. Would you be able to make a pull request, please? Also, do we need to do the same fix in other classes?