https://kotlinlang.org logo
#http4k
Title
# http4k
v

Vojtěch Knyttl

04/09/2021, 6:34 PM
is there a reason an example is not showing in OpenAPI for such definition (the content type is missing as well):
Copy code
returning(Status.OK, Body.string(ContentType.TEXT_PLAIN).toLens() to "example string")
d

dave

04/09/2021, 6:44 PM
From memory, we only handle JSON content types in the OpenApi contract stuff., because we can't build a model out of anything else
v

Vojtěch Knyttl

04/09/2021, 6:45 PM
Ah, okay, domage
r

Razvan

04/09/2021, 6:56 PM
Yes, looks like that. I suppose it’s this filter in
OpenApi3.kt
that does that:
Copy code
private fun List<HttpMessageMeta<Response>>.collectSchemas() = groupBy { CONTENT_TYPE(it.message) }
        .filterKeys { it == APPLICATION_JSON }
🥲 1