【发布时间】:2019-08-26 14:23:18
【问题描述】:
我正在使用 autoRest 从一个 swagger 架构生成一个新客户端。我在模型中有 DateTime 列表
public class DateRange
{
public IList<DateTime> Dates{ get; set; }
}
这是从该属性生成的 Json swagger 架构
{ ...
"Dates": {
"type": "array",
"items": {
"format": "date-time",
"type": "string"
}
}
...
}
这是我运行 autoRest 后得到的结果
public class DateRange
{
[JsonProperty(PropertyName = "Dates")]
public IList<System.DateTime?> Dates{ get; set; }
}
我想获得一个类似这样的不可为空的 dateTime 属性
public IList<System.DateTime> Dates{ get; set; }
【问题讨论】:
-
这闻起来像 autorest 中的错误,您应该在那里报告。
标签: c# asp.net-web-api swagger-2.0 swashbuckle autorest