Feature Description
Java 8 introduced the Date/Time API that has largely replaced Joda-Time.
Relatively recently, OpenAPI has created a Formats Registry that contains format that map nicely to the Java 8 objects.
Use Case
Date/Time is a really complex system
The current version (2.2.49) only support 2 types:
static class TestObjectDates {
public ZonedDateTime zonedDateTime = ZonedDateTime.parse("2007-12-03T10:15:30+01:00[Europe/Paris]"); // ❌ 'date-time', no format exists in the registry for this type yet
public OffsetDateTime offsetDateTime = OffsetDateTime.parse("2007-12-03T10:15:30+01:00"); // 🐛 complex object, should be 'date-time'
public Instant instant = Instant.parse("2007-12-03T10:15:30+01:00"); // ✅
public LocalDateTime localDateTime = LocalDateTime.parse("2007-12-03T10:15:30"); // 🐛 'date-time', should be 'date-time-local'
public LocalDate localDate = LocalDate.parse("2007-12-03"); // ✅
public OffsetTime offsetTime = OffsetTime.parse("10:15:30+01:00"); // 🐛 complex object, should be 'time'
public LocalTime localTime = LocalTime.parse("10:15:30"); // 🐛 complex object, should be 'time-local'
public Duration duration = Duration.parse("PT10H15M30S"); // 🐛 complex object, should be 'duration'
}
Suggested Solution
Built-in support in swagger-core, I opened #5113 to support 'date-time-local'. I don't mind fixing every other types if this issue is accepted
Checklist
Feature Description
Java 8 introduced the Date/Time API that has largely replaced Joda-Time.
Relatively recently, OpenAPI has created a Formats Registry that contains format that map nicely to the Java 8 objects.
Use Case
Date/Time is a really complex system
The current version (2.2.49) only support 2 types:
Suggested Solution
Built-in support in swagger-core, I opened #5113 to support 'date-time-local'. I don't mind fixing every other types if this issue is accepted
Checklist