Version 4

    Built in YAML provider


    Since Beta 6, resteasy comes with built in support for YAML using the Jyaml library. To enable YAML support, you need to drop in the jyaml-1.3.jar in RestEASY's classpath.




    Jyaml jar file can either be downloaded from sourceforge:


    Or if you use maven, the jyaml jar is available through the main repositories and included using this dependency:




    When starting resteasy look out in the logs for a line stating that the YamlProvider has been added - this indicates that resteasy has found the Jyaml jar:


    2877 Main INFO org.jboss.resteasy.plugins.providers.RegisterBuiltin - Adding YamlProvider


    Mime Types


    The Yaml provider recognises three mime types:


    • text/x-yaml

    • text/yaml

    • application/x-yaml




    This is an example of how to use Yaml in a resource method.


    public class YamlResource
       public MyObject getMyObject() {
          return createMyObject();