如何解决昂首阔步不接受UI中的值
我仅对于PATCH API速写文档观察到奇怪的行为。路径变量标记为“ ref”参数,不接受提交值。
请注意,对于GET,POST或PUT API文档而言,不会发生这种情况。您可以在下面看到区别。
这是昂首阔步的API配置:
@ApiOperation(value = "update Jurisdictions",response = JurisdictionDto.class,authorizations = {@Authorization(value = "oauth2schema")})
@ApiResponses(value = {
@ApiResponse(code = 200,message = "OK"),@ApiResponse(code = 401,message = "Unauthorized",response = AuthenticationError.class),@ApiResponse(code = 403,message = "Access Denied",response = AuthorizationError.class),@ApiResponse(code = 404,message = "Not found",response = NotFoundError.class),@ApiResponse(code = 500,message = "Internal server error",response = InternalServerError.class)
})
@ApiImplicitParams({
@ApiImplicitParam(name = "jurisdiction",value = "jurisdiction",required = true,dataType = "integer",paramType = "path"),@ApiImplicitParam(
name = "patch",value = "patch",dataType = "JsonPatchProperty",required = true)
})
@PatchMapping(value = "/v1/jurisdictions/{jurisdiction}",consumes = "application/json-patch+json")
public ResponseEntity<JurisdictionDto> updateJurisdiction(@PathVariable("jurisdiction") long id,@RequestBody(required = true) JsonPatch patch) {
return ResponseEntity.ok(jurisdictionSvc.getAndUpdate(id,patch));
}
有人可以告诉我这是怎么回事吗?
解决方法
尝试使用对象类型Long
代替基本类型long
作为方法参数。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。