Description
When generating examples with for date-time types with the ExampleBuilder
the returned example value does not comply with the format as described in the documentation.
The Data-type documentation references rfc3339 section 5.6 as format for date-time.
This RFC states that time-second
is required
partial-time = time-hour ":" time-minute ":" time-second
[time-secfrac]
full-date = date-fullyear "-" date-month "-" date-mday
full-time = partial-time time-offsetdate-time = full-date "T" full-time
Swagger uses OffsetDateTime.html#toString() for creating the value of date-time example. This method states it will strip the second part when it is empty.
The output will be one of the following ISO-8601 formats:
uuuu-MM-dd'T'HH:mmXXXXX
uuuu-MM-dd'T'HH:mm:ssXXXXX
uuuu-MM-dd'T'HH:mm:ss.SSSXXXXX
uuuu-MM-dd'T'HH:mm:ss.SSSSSSXXXXX
uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSSXXXXX
This conflicts with the format as state in the data-types documentation.
In stead of toString()
a formatted value should be used. For example DateTimeFormatter.html#ISO_INSTANT