如何显示Swagger UI文档中父类中定义的路径?

时间:2019-04-30 13:57:42

标签: java swagger swagger-ui

我的Swagger UI文档(版本3.20.3)缺少在父类中定义的路径。

"paths": {
    "/cfitypes/{id}/clone":
    {
        "get":
        {
            "tags":["CfiTypes"],
            "summary":"Create copy of object - VISIBLE ONLY IF METHOD IS OVERRIDDEN",
            ...
        }
    }
}

仅当在特定类(CfiTypesEndpoint)中覆盖它时,该属性才可见。但是这样,我必须重写所有继承的类中的方法。

public interface BasicEndpoint {
   @GET
   @Path(CLONE)
   @Produces(MediaType.APPLICATION_JSON)
   RestResponse getClone(@PathParam(ID_PARAM) String id);
}
public abstract class AbstractEndpoint implements BasicEndpoint {
   @Override
   @ApiOperation(value = "Create copy of object - VISIBLE ONLY IF METHOD  IS OVERRIDDEN")
   @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "Id of the object", required = true, paramType = "path", dataType = "string") })
   public RestResponse getClone(@ApiParam(hidden = true) String id) {
      return null;
   }
}
@Api(value = "CfiTypes")
@Path(ApiUriConstants.CFITYPES)
public class CfiTypesEndpoint extends AbstractEndpoint {
   /*
   I have to override getClone method to see it Swagger UI documentation !!!
    */
//   @Override
//   public RestResponse<CfitypesREST> getClone(String id) {
//      return super.getClone(id);
//   }
}

我做错什么了吗?我试图在文档中查看所有继承的方法路径。有什么办法可以查看所有父类的所有路径吗?谢谢。

0 个答案:

没有答案