Spring boot 如何将Spring数据Rest的补丁和swagger文档分开?
我使用SpringDataREST+Springfox(招摇过市)。我想分别为PATCH和PUT提供文档,但它们都映射到一个函数调用:Spring boot 如何将Spring数据Rest的补丁和swagger文档分开?,spring-boot,swagger,springfox,Spring Boot,Swagger,Springfox,我使用SpringDataREST+Springfox(招摇过市)。我想分别为PATCH和PUT提供文档,但它们都映射到一个函数调用: @RepositoryRestResource public interface OrderRepository extends JpaRepository<Order, Long> { @ApiOperation(value = "Create new order") Order save(Order order); } @R
@RepositoryRestResource
public interface OrderRepository extends JpaRepository<Order, Long> {
@ApiOperation(value = "Create new order")
Order save(Order order);
}
@RepositoryRestResource
公共接口OrderRepository扩展了JpaRepository{
@ApiOperation(value=“创建新订单”)
订单保存(订单);
}
如何将其分为两个函数调用?我没有控制器,因为SDR生成它 如果每个请求方法需要两个不同的API文档,那么还需要两个单独的端点。使用接口的默认方法功能来启用所需的功能
@RepositoryRestResource
公共接口OrderRepository扩展了JpaRepository{
//这种方法是为了招摇过市而隐藏的
订单保存(订单);
@补丁映射
@ApiOperation(value=“部分修改订单”)
默认订单修改(订单){
返回保存(订单);
}
@PutMapping
@ApiOperation(value=“创建新订单或替换现有订单”)
默认订单更新(订单){
返回保存(订单);
}
}
刚刚尝试了这个,没有成功。PUT/PATCH/POST仍然链接到相同的招摇过市文档