0
让说,我有以下的模型排除性能从扬鞭UI被列
public class UserResourceParameters
{
public string FirstName { get; set;}
public string LastName { get; set; }
public string FullName { get => FirstName + " " + LastName; }
}
而下面的控制器操作
[HttpGet]
public IActionResult Get(UserResourceParameters resourceParameters)
{
...
}
当我运行我的应用程序,去招摇接口/ UI对于上述行为,它列出了所有3个属性作为可接受的参数
- 名字
- 姓氏
- 全名
其实我不想扬鞭显示FullName
为接受的参数之一,因为现在我只希望它是一个干将。
我怎样才能让swagger只显示FirstName
和LastName
作为可接受的参数?
它不起作用。 'FullName'仍然显示为参数之一。 – muhihsan
您使用什么工具进行swagger模式生成? –
我正在使用Swashbuckle.AspNetCore https://github.com/domaindrivendev/Swashbuckle.AspNetCore – muhihsan