Swagger shows as string when using org.joda.time.LocalDateTime for date fields

691 views
Skip to first unread message

shanti sattiraju

unread,
Jun 3, 2016, 11:03:46 AM6/3/16
to Swagger
Team,

We have below issue the way swagger is reflecting in the generated docs.

For Ex in my Java class I have

import org.joda.time.LocalDate;

@ApiModelProperty(value = "Dateate of birth, e.g., 1965-09-26")
private LocalDate dateOfBirth;

Then in the documentation,I see

dateOfBirth(string,...).

What can be done to see dateOfBirth(LocalDate,...)?Any pointers on this is appreciated.

Ron Ratovsky

unread,
Jun 3, 2016, 2:33:21 PM6/3/16
to swagger-sw...@googlegroups.com

By definition, it’s a string. There’s no LocalDate data type in Swagger/OpenAPI/JSON Schema.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shanti sattiraju

unread,
Jun 3, 2016, 2:37:01 PM6/3/16
to swagger-sw...@googlegroups.com
Thank You.But if I change org.joda.time.LocalDate to java.time.LocalDate,it shows me as LocalDate instead of string.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/iypn3ouOhpo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.

Ron Ratovsky

unread,
Jun 3, 2016, 2:37:48 PM6/3/16
to swagger-sw...@googlegroups.com

 

 

Well, it shouldn’t.

tony tam

unread,
Jun 4, 2016, 7:11:33 PM6/4/16
to swagger-sw...@googlegroups.com
Can you please open an issue in swagger-core for this?  You should not see `LocalDate` for the java.time.LocalDate.

shanti sattiraju

unread,
Jun 6, 2016, 3:26:32 PM6/6/16
to Swagger
How can I log it in swagger-core.i see that it is linked to the same forum

Ron Ratovsky

unread,
Jun 6, 2016, 3:32:05 PM6/6/16
to swagger-sw...@googlegroups.com

 

 

From: <swagger-sw...@googlegroups.com> on behalf of shanti sattiraju <shantis...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Monday, 6 June 2016 at 12:26
To: Swagger <swagger-sw...@googlegroups.com>
Subject: Re: Swagger shows as string when using org.joda.time.LocalDateTime for date fields

 

How can I log it in swagger-core.i see that it is linked to the same forum

--

Reply all
Reply to author
Forward
0 new messages