ebowman/api-first-hand

No string constructor/factory method for date-time

pocman opened this issue · 6 comments

With this yaml :

  task:
    type: object
    properties:
      complete_before:
        type: string
        format: date-time
      complete_after:
        type: string
        format: date-time

Using the generated example for the post :

{
  "complete_before": "2016-07-25T13:15:53.208Z",
  "complete_after": "2016-07-25T13:15:53.208Z"
}

triggers this error :

<p id="detail" class="pre">[JsonMappingException: Can not instantiate value of type [simple type, class org.joda.time.DateTime] from String value (&#x27;2016-07-25T13:07:40.517Z&#x27;); no single-String constructor/factory method
 at [Source: [B@4e6bc7b1; line: 34, column: 22] (through reference chain: workload.yaml.NewTask[&quot;complete_before&quot;])]</p>

But this is working :

{
  "complete_before": 1469452060,
  "complete_after": 1469452060,
}

See #20

nmcb commented

@slavaschmidt can i have a try?

@ I started Top redesign marshalling part recently. I tend to generate play writeables and readables for that. Made a POC today but still need some time to code it properly

@nmcb sorry, previous comment was for you

nmcb commented

@slavaschmidt nice! wanna sync this week?

Fixed in 0.2