I created a Quarkus project using https://code.quarkus.io (with RESTEasy Jackson extension), a Greeting class defined as:
public class Greeting {
private final String message;
public Greeting(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
}
And a JAX-RS endpoint to return it as YAML, so I wrote the following code:
@Path("/greeting")
public class GreetingResource {
@GET
@Produces("application/yaml")
public Greeting hello() {
return new Greeting("hello");
}
}
I also added the following dependency to my Quarkus project to return YAML:
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-yaml-provider</artifactId>
</dependency>
However when I hit the endpoint, the following error is shown:
2020-05-22 10:55:55,693 ERROR [org.jbo.res.res.i18n] (executor-thread-1) RESTEASY002010: Failed to execute: javax.ws.rs.NotSupportedException: RESTEASY003200: Could not find message body reader for type: class org.acme.sample.Greeting of content type: application/yaml; charset=ISO-8859-1
What's the recommended way to fix this?