此内容没有您所选择的语言版本。
Chapter 21. YAML Provider
Since Beta 6, RESTEasy includes built-in support for YAML with the JYAML library. To enable YAML support, add the
jyaml-1.3.jar to RESTEasy's classpath.
The JYAML
JAR can be downloaded from SourceForge.
If you use Maven, the JYAML
JAR is available through the main repositories, and included with the following dependency:
When starting up RESTEasy, watch the logs for a line stating that the
YamlProvider has been added — this indicates that RESTEasy has located the JYAML JAR:
2877 Main INFO org.jboss.resteasy.plugins.providers.RegisterBuiltin - Adding YamlProvider
2877 Main INFO org.jboss.resteasy.plugins.providers.RegisterBuiltin - Adding YamlProvider
The YAML provider recognizes three MIME types:
text/x-yamltext/yamlapplication/x-yaml
You can use YAML in a resource method like so: