You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The current version (2.2.49) only support 2 types:
staticclassTestObjectDates {
publicZonedDateTimezonedDateTime = ZonedDateTime.parse("2007-12-03T10:15:30+01:00[Europe/Paris]"); // ❌ 'date-time', no format exists in the registry for this type yetpublicOffsetDateTimeoffsetDateTime = OffsetDateTime.parse("2007-12-03T10:15:30+01:00"); // 🐛 complex object, should be 'date-time'publicInstantinstant = Instant.parse("2007-12-03T10:15:30+01:00"); // ✅publicLocalDateTimelocalDateTime = LocalDateTime.parse("2007-12-03T10:15:30"); // 🐛 'date-time', should be 'date-time-local'publicLocalDatelocalDate = LocalDate.parse("2007-12-03"); // ✅publicOffsetTimeoffsetTime = OffsetTime.parse("10:15:30+01:00"); // 🐛 complex object, should be 'time'publicLocalTimelocalTime = LocalTime.parse("10:15:30"); // 🐛 complex object, should be 'time-local'publicDurationduration = 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
I have searched the existing issues to ensure this is not a duplicate.
This feature would be useful to more than just my use case.
I have provided enough detail for the maintainers to understand the scope of the request.
Activity
feat: support Java 8 date/time formats per OpenAPI Formats Registry (#…
daniel-kmiecik commentedon Aug 13, 2026
Thank for pointing this out!
Fix for this (#5184) will be available in the next release.
Update dependency io.swagger.core.v3:swagger-core-jakarta to v2.2.55 …