cancel
Showing results for 
Search instead for 
Did you mean: 

swagger-core/swagger-jaxrs2 misbehaving with date-time properties?

Frequent Visitor

swagger-core/swagger-jaxrs2 misbehaving with date-time properties?

I've noticed some weird behavior on one of the sample projects: a `java.util.Date` property is spec'd as `string($date-time)` but at runtime it is rendered as a integer value. The sample project is called `java-jersey2-resourceinit` and lives at the 2.0 branch of the swagger-samples repo.

 

This seemed like a duplicate of #2680 and I've added a comment to the issue.

 

In my code, I'm currently overriding the generated spec with a hardcoded Schema annotation:

 

 

`@Schema(type = "integer", format = "int64")`

 

 

Do you folks recommend any other approach?

1 REPLY 1
Staff

Re: swagger-core/swagger-jaxrs2 misbehaving with date-time properties?

The approach you suggested is valid, a few more options in comment of ticket https://github.com/swagger-api/swagger-core/issues/2680

New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2
Top Kudoed Authors