AbpApiExceptionFilterAttribute-一个值是必需的,但在请求中不存在

时间:2018-09-29 00:16:15

标签: aspnetboilerplate asp.net5

我有一个如下所示的webapi控制器:

[ResponseType(typeof(SampleDto))]
public IHttpActionResult GetSample(string name, string guid)

,请求将名称和guid作为查询字符串,例如: http://www.example.com/api/Controller1/GetSample?name=james&guid=

guid为空。

我发出请求时,出现错误:

WARN  2018-09-29 07:04:21,361 [18   ] nHandling.AbpApiExceptionFilterAttribute - Method arguments are not valid! See ValidationErrors for details.
Abp.Runtime.Validation.AbpValidationException: Method arguments are not valid! See ValidationErrors for details.
WARN  2018-09-29 07:04:21,361 [18   ] nHandling.AbpApiExceptionFilterAttribute - There are 2 validation errors:
WARN  2018-09-29 07:04:21,361 [18   ] nHandling.AbpApiExceptionFilterAttribute - A value is required but was not present in the request. (guid.String)
WARN  2018-09-29 07:04:21,361 [18   ] nHandling.AbpApiExceptionFilterAttribute - A value is required but was not present in the request. (guid.String)

在哪里可以更改验证规则?

0 个答案:

没有答案