我正在嘗試使用Swagger作爲我的Scala基於來自wordnik的swagger-play2播放2.2項目。在處理Joda DateTime時似乎有問題。使用wordnik樣片播放項目,在「訂單」案例類,Swagger播放框架2.2 - Joda日期時間問題
@ApiModel("Order")
case class Order (
@(ApiModelProperty @field)(position=1)id: Long,
@(ApiModelProperty @field)(position=2)petId: Long,
@(ApiModelProperty @field)(position=3)quantity: Int,
@(ApiModelProperty @field)(position=4)shipDate: DateTime,
@(ApiModelProperty @field)(position=5)status: String
)
我改變了SHIPDATE從Java日期喬達DateTime和它拋出,當我來電/店/訂單API錯誤:
[JsonMappingException: Class org.joda.time.tz.CachedDateTimeZone has no default constructor;
can not instantiate default bean value to support 'properties=JsonSerialize.Inclusion.NON_DEFAULT' annotation
(through reference chain: scala.collection.convert.SeqWrapper[0]->models.Order["shipDate"]->org.joda.time.DateTime["zone"])]
任何想法?
謝謝。