Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
j4m3s opened this issue Jul 18, 2012 · 6 comments
Open

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

j4m3s opened this issue Jul 18, 2012 · 6 comments
Labels

Comments

@j4m3s
Copy link

j4m3s commented Jul 18, 2012

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
Copy link
Owner

FroMage commented Jul 24, 2012

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

@j4m3s
Copy link
Author

j4m3s commented Jul 25, 2012

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
Copy link
Owner

FroMage commented Jul 25, 2012

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

@j4m3s
Copy link
Author

j4m3s commented Jul 25, 2012

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 <
[email protected]

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:
#45 (comment)

@FroMage
Copy link
Owner

FroMage commented Jul 25, 2012

Great!

@j4m3s
Copy link
Author

j4m3s commented Jul 26, 2012

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" [email protected]
To: "j4m3s" [email protected]
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:
#45 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants