aspnetboilerplate - AbpApiExceptionFilterAttribute - 需要一个值,但请求中不存在
问题描述
我有一个如下的 webapi 控制器:
[ResponseType(typeof(SampleDto))]
public IHttpActionResult GetSample(string name, string guid)
并且请求将名称和 guid 作为查询字符串,例如: http ://www.example.com/api/Controller1/GetSample?name=james&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)
我在哪里可以更改验证规则?
解决方案
推荐阅读
- ios - 创建应用程序不工作的可下载 ios 链接
- docker - 通过配置文件设置 gitlab-ci 服务
- docker - Traefik 2.0 和 docker 简单配置不起作用
- c# - Authorization_IdentityNotFound 从守护程序应用程序访问 Microsoft Graph
- spring-batch - ExecutionContext 信息的 StepContribution 或 ChunkContext
- r - 当日期范围跨越日历年的更改时,将行拆分为两行
- python - 《函数调用栈:keras_scratch_graph》——手套嵌入文本情感分析
- xpath - 在 Google 表格 ImportXML 中提取元数据
- android - 没有 LeakCanary 的 Profiler 中的 android-Memory 使用量不会减少
- angular - 找不到具有未指定名称属性的控件 (formArray)