documentation home

FAQ  The same resource is documented twice


Problem

If you put interfaces and implementation classes in the same maven module and both have @Path annotations, Miredot might consider the same resource twice.

For example, suppose you have these classes

package demo;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

public abstract class A<T> {
    @GET
    @Path("/object")
    public abstract T getObject();
}

@Path("/b")
public class B extends A<String> {
    @Override
    public String getObject() {
        return null;
    }
}

Miredot will generate

GET /object
GET /object/b

Solution

Annotate the interface/abstract class with @MireDotIgnore as follows:

package demo;
import com.qmino.miredot.annotations.MireDotIgnore;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

@MireDotIgnore
public abstract class A<T> {
    @GET
    @Path("/object")
    public abstract T getObject();
}