Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Merge methods of root resources #74

Open
enriquerodbe opened this issue Aug 8, 2014 · 4 comments
Open

Merge methods of root resources #74

enriquerodbe opened this issue Aug 8, 2014 · 4 comments

Comments

@enriquerodbe
Copy link

If you have to root resources like:

@Path("/resource")
public interface ResourceInterfaceOne {
    @GET
    @Path("/foo")
    void doSomething();
}

@Path("/resource")
public interface ResourceInterfaceTwo {
    @POST
    @Path("/bar")
    void doSomething();
}

The doclet will generate two json files with the same name (resource.json) and it will break the UI.

One solution would be taking all the methods from both resources and combining them into a single one.

enriquerodbe added a commit to thisisqubika-archive/swagger-jaxrs-doclet that referenced this issue Aug 10, 2014
@conorroche
Copy link

ive a fork that also supports this https://github.com/Carma-Public/swagger-jaxrs-doclet using the -crossClassResources option, this fork is for swagger 1.2 btw.

@bobpiece
Copy link

@conorroche indeed your "-crossClassResources" option resolves problem, but it doesn't work for projects where you have both: cross class resources and sub class resources. As long as CrossClassApiParser have no support for sub-resources, I would recommend to enhance older parser with cross class resources support(solution provided by @enriquerodbe).

@conorroche
Copy link

@bobpiece thanks i have that (support for sub resources on the cross class parser) on my roadmap but will bring it forward to the 1.0 release and try to work on it in the next couple of days

@conorroche
Copy link

i have now committed support for sub resources to the cross class parser and removed the old one so there is now a single parser. the old doclet option to choose the cross class parser is no longer necessary. I have also added test cases for sub resource classes, combinations of sub resources and cross class resources and for the original example given by @enriquerodbe

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

No branches or pull requests

3 participants