嵌套资源子资源的 OpenApi 生成器JAVA、JAX-RS

问题描述

是否可以使用 OpenApi 生成生成嵌套资源(子资源)? 这个想法是有一些 yaml 文件生成正确的资源和子资源文件。像这样:

@Path("resource")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class SomeResource {
   @Inject
   ResourceService resourceService;

   @GET
   @Path("{id}")
   public Response getResource(@PathParam("id") String id) {
      resourceService.getResource(...)
      return Response... 
   }
   ... other POST,PUT,DELETE
 
   @Path("{id}/sub-resource")
   public Response subResource(@PathParam("id") String id) {
      return new SubResource(...);
   }
}


class SubResource {
  // endpoints 
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)