Hey, is there a way to specify the format for a pr...
# http4k
m
Hey, is there a way to specify the format for a property of a dto in the OpenAPI json? E.g. I'm trying to make it specify a property
startDate
is a date. Currently in my swagger.json it has:
Copy code
"startDate": {
  "example": "2021-01-01",
  "description": null,
  "type": "string"
},
but (i think) i'm expecting:
Copy code
"startDate": {
  "example": "2021-01-01",
  "description": null,
  "type": "string",
  "format": "date"
},
I've defined my bidi lens as:
Copy code
BiDiMapping<String, LocalDate>({ LocalDate.parse(it) }, { it.format(DateTimeFormatter.ISO_LOCAL_DATE) })
d
Sorry - Unfortunately not out of the box, because the base lens actually doesn't know anything about the type - it's just a string as far as the renderer is concerned. It's possible that you could do something with annotations, but without building a custom renderer ... (And it's complicated enough! 😂)
m
Ah sad times, well I'll leave it for now then
thanks anywho