有人知道一种方法可以提供一些示例数据以显示在响应模型的 ServiceStack 的元数据页面上吗?
对于此响应模型
public class GetIncidentResponse
{
public IEnumerable<Incident> Incidents { get; set; }
}
我在元数据页面上得到这个
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{}
当我希望能够显示类似
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{ "Filter example 1", "Filter example 2"}
@mythz评论解决了我的问题。将 IEnemerable 接口更改为 IList 有效。