Org.joda.LocalTime view in Swagger

We are using Swagger (1.5.15) to render our rest api.

To represent the time we use org.joda.LocalTime (can't use java8 time for legacy reasons). The api works as expected with time formatted as "HH: MM: SS" however the swagger shows it as

"LocalTime": {
  "type": "object",
  "properties": {
    "chronology": {
      "$ref": "#/definitions/Chronology"
    },
    "millisOfDay": {
      "type": "integer",
      "format": "int32"
    },
    "hourOfDay": {
      "type": "integer",
      "format": "int32"
    },
...

      

Which (if I'm not mistaken) means the problem is not with the Swagger-UI.

We tried different versions of Swagger together with

@ApiModelProperty(dataType = "org.joda.time.LocalTime", example = "10:11:12")

      

no luck.

Any help would be greatly appreciated.

+3


source to share





All Articles