开发者

Using Enunciate with Grails

开发者 https://www.devze.com 2023-03-25 08:28 出处:网络
I am creating Web APIs, in a RESTful manner. Grails of course has good support for creating REST web services. Enunciate claims to help in the API part, where things like documentation, client librari

I am creating Web APIs, in a RESTful manner. Grails of course has good support for creating REST web services. Enunciate claims to help in the API part, where things like documentation, client libraries, etc are important.

The purpose of this post is to invite experiences on using Enunciate with Grails, or ideas on how that can be done.

There are two main issues using them together:

  1. Enunciate works with JAX-RS, not the native imple开发者_运维百科mentation of REST by Grails. Thankfully there's a JAX-RS plugin available, but am not sure if Enunciate will be able to work with it.

  2. Grails domain classes are in Groovy while Enunciate works with Java source code (example).


Enunciate works with both Java source code and Java compiled bytecode to do its work. But if you don't have Java source code, Enunciate won't be able to pull stuff out of your JavaDocs to enhance its generated documentation. Given that, there should (theoretically) be a way to apply Enunciate to compiled Groovy bytecode, but your docs won't be as rich because Enunciate won't be able to see your JavaDoc documentation. I say theoretically because I don't have any personal experience with it nor do I know how painful it is to pull off.

There is an open issue at ENUNCIATE-356 to investigate this complexity. Note that ENUNCIATE-356 depends on ENUNCIATE-584, which might get some more traction soon, being driven by ENUNCIATE-585 as we move from using APT (introduced in Java 5, deprecated in Java 7) to the Javac tool (introduced in Java 6). It would be interesting to know whether the Javac tool supports languages other than Java, in which case we'd get Groovy support for free.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号