FroMage / jax-doclets

Set of JavaDoc doclets for modern Java annotations APIs
http://www.lunatech-labs.com/open-source/jax-doclets
GNU Lesser General Public License v3.0
26 stars 23 forks source link

Parser/ docs do not recurse into @Form tags #45

Open j4m3s opened 12 years ago

j4m3s commented 12 years ago

One of the powerful features of the RESTEasy @Form tag is that a @Form can have @Form fields within it, allowing reused field to be repeated across the services using common names and validation parameters.

However, it doesn't appear that jax-doclets recognises (or processes) fields that are annotated with an @Form tag.

In the API, any @Form paramters should be processed recursively, pulling-out all @...Param fields from all nested @Form objects and including them in the API document as if they were all just normal parameters (which is how RESTEasy handles them).

Great software btw :)

FroMage commented 12 years ago

Ah ok I didn't know. If you can provide a pull request I'll apply it.

j4m3s commented 11 years ago

I'm not too familiar with how github works but assuming a pull request is related to a git commit/ patch, I need some advice please. I did clone the code and started to make some adjustments to do the recursion, but I couldn't figure out how the flow in works inside the program.

I modified ResourceMethod.java to recurse whenever it processed an @Form field annotation (in the walkFormParameter(..) method I had it create a new ResourceMethod object for each @Form field), but couldn't figure out what I needed to do to have the new ResourceMethod object start parseing.

(FYI I modified the List fields to be default-access so that they could be used by the recursing ResourceMethod objects).

To be honest the changes I made may actually work, but I couldn't see how to test it through Maven.

FroMage commented 11 years ago

You can run the tests on the sample with mvn -pl doclets integration-test and the result will be in doclets/target/jaxrsdocs/

j4m3s commented 11 years ago

Thanks, I'll update one of the test classes to include a @Form field and give it a try later.

On Wed, Jul 25, 2012 at 10:00 AM, Stéphane Épardaud < reply@reply.github.com

wrote:

You can run the tests on the sample with mvn -pl doclets integration-test and the result will be in doclets/target/jaxrsdocs/


Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/45#issuecomment-7244017

FroMage commented 11 years ago

Great!

j4m3s commented 11 years ago

Submitted the pull request last night - the change was simpler than I expected.

In working on it I found that the latest version of jaxb doclet in github generates a javadoc exception when parsing the xmlaccessortype annotations. It isn't an issue related to the general release download so probably shouldn't be registered in this issue tracker - where should I post it? (i spent a few hours trying to track down the cause last night but didn't make any headway).

Regards, James.

----- Reply message ----- From: "Stéphane Épardaud" reply@reply.github.com To: "j4m3s" james.fellows@finanscapes.com Subject: [jax-doclets] Parser/ docs do not recurse into @Form tags (#45) Date: Wed, Jul 25, 2012 4:00 pm

Great!


Reply to this email directly or view it on GitHub: https://github.com/FroMage/jax-doclets/issues/45#issuecomment-7251370