C# 从主体生成通用参数的招摇过市模型
我目前正在做一个项目,我们会自动生成所有控制器。我们的BaseController有一个类似这样的操作:C# 从主体生成通用参数的招摇过市模型,c#,asp.net-core,swagger,swashbuckle,nswag,C#,Asp.net Core,Swagger,Swashbuckle,Nswag,我目前正在做一个项目,我们会自动生成所有控制器。我们的BaseController有一个类似这样的操作: [HttpPost("")] public virtual Task<IActionResult> Create([FromBody] ICreateEntityModel<TBaseEntity> model) { return ProcessActionAsync(model); } 接口只是一个标记,API用户对
[HttpPost("")]
public virtual Task<IActionResult> Create([FromBody] ICreateEntityModel<TBaseEntity> model)
{
return ProcessActionAsync(model);
}
接口只是一个标记,API用户对此不感兴趣。是否有方法为实际类型(在本例中为Person)而不是接口生成模型?我是缺少正确的配置还是需要额外的处理器?使用
[ProducesResponseType(200,typeof(…)]
指定给定状态代码的响应类型。[ProducesResponseType(typeof(ErrorMessage),StatusCodes.Status400BadRequest]
为我工作
ICreateEntityModelOfPerson:{
type:"object",
x-abstract:true,
additionalProperties:false
}