<chapter id="Built_in_YAML_Provider">
   <title>YAML Provider</title>

   <para>

      Since 2.3.5.Final  release, resteasy comes with built in support for YAML using the SnakeYAML library. To enable YAML support,
      you need to drop in the SnakeYaml 1.8 jar and the resteasy-yaml-provider.jar (whatever the current version is) in RestEASY's classpath.
   </para>
   <para>


   </para>
   <para>

      SnakeYaml jar file can either be downloaded from Google code at
       http://code.google.com/p/snakeyaml/downloads/list
   </para>
   <para>

      Or if you use maven, the SnakeYaml jar is available through SonaType public repositories and included using this
      dependency:
   </para>
   <para>

 <programlisting>
 &lt;dependency&gt;
&lt;groupId&gt;org.yaml&lt;/groupId&gt;
&lt;artifactId&gt;snakeyaml&lt;/artifactId&gt;
&lt;version&gt;1.8&lt;/version&gt;
 &lt;/dependency&gt;
      </programlisting>
   </para>
   <para>

      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:
   </para>
   <para>

      2877 Main INFO org.jboss.resteasy.plugins.providers.RegisterBuiltin - Adding YamlProvider
   </para>
   <para>


   </para>
   <para>

      The Yaml provider recognises three mime types:
   </para>
   <para>

      <itemizedlist>

         <listitem>
            text/x-yaml
         </listitem>

         <listitem>
            text/yaml
         </listitem>

         <listitem>
            application/x-yaml
         </listitem>

      </itemizedlist>

   </para>
   <para>


   </para>
   <para>

      This is an example of how to use Yaml in a resource method.
   </para>
   <para>

 <programlisting>
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;

 @Path("/yaml")
 public class YamlResource
 {

@GET
@Produces("text/x-yaml")
public MyObject getMyObject() {
   return createMyObject();
}
...
 }
 </programlisting>
   </para>
   <para>

   </para>
   <para>

   </para>
   <para>


   </para>
</chapter>
