Monday, May 16, 2011

My small contribution to RESTEasy project

I am working on some example to play with Infinispan and in this example, I wanted to store a YAML blob in the cache and play with Infinispan's different cache configuration options. To consume a YAML blob, I developed a REST interface using RESTEasy. RESTEasy's YAML provider worked pretty well but for the case when blob did not comply with YAML syntax. As expected, it would throw error but error message was far from helpful:


Caused by: java.lang.NullPointerException
at org.ho.yaml.JYamlParserEvent.getBean(Unknown Source)
at org.ho.yaml.YamlDecoder.readObject(Unknown Source)
at org.ho.yaml.YamlConfig.load(Unknown Source)
at org.ho.yaml.YamlConfig.load(Unknown Source)
at org.ho.yaml.Yaml.load(Unknown Source)

As of 2.0.1 RESTEasy version, YAML support was provided using JYAML which is not under development anymore. So I gave a shot at integrating SnakeYaml which is a very active project with good community around it. It was not a whole lot of work and it did not cause any regression in my local testing so I went ahead and committed to trunk after discussing with Bill. Thanks Bill. More details are at https://issues.jboss.org/browse/RESTEASY-543 . I updated the RESTEasy's doc as well..isn't that nice? ;-)

No comments: