【问题标题】:Providing Response Model sample JSON data on the metadata page in ServiceStack在 ServiceStack 的元数据页面上提供响应模型示例 JSON 数据
【发布时间】:2014-03-30 02:08:26
【问题描述】:

有人知道您可以提供一些示例数据以显示在 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"}

【问题讨论】:

标签: servicestack


【解决方案1】:

@mythz 评论解决了我的问题。将 IEnemerable 接口更改为 IList 有效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多