What should be the format of the date that should be received in response in Swagger 2.0

  • 9 January 2020
  • 1 reply
  • 8 views

I am using Swagger 2.0. I have a field in the Response where 

type: string

format: date

What should be the format of this field so that it can be displayed succesfully.

 

Currently, the date is received in the format 13/12/2019 (DD/MM/YYYY). 

And when displaying in the list view, it throws an error "Encountered a problem calling REST service. (Inner: Could not convert string to DateTime: 13/12/2019. Path 'registers[11].receptionDateMetLife', line 1, position 3583.)

 

Can you please suggest what is the approach to resolve this error?

 

 


1 reply

Hello,

 

I can't say all ways you can write it on but can say a way that works.

Checked some REST that is up and running datetime in them is on format 

yyyy-MM-dd'T'HH:mm.SSS'Z'

example data "20*personal details removed*T15:05.000Z"

 

tested "yyyy-MM-dd'T'HH:mm:ss", works as well.

 

Regards

/Björn

Reply