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

Razvan

11/17/2020, 7:07 PM
Hi, I was wandering if the
OpenApi3ApiRenderer
should render or not null values giving that OpenAPI specification clearly states that
null
 is not supported as a type.
Ok you can disable null from Json but it's not the default, requires a custom config, but I think the OpenApi3Renderer should (at least by default) follow to the specifications of the format it claim to render. Don't you think ?
d

dave

11/17/2020, 7:08 PM
We just need to create a Jackson instance to put into it by default. Feel free to PR it. 🙂
r

Razvan

11/17/2020, 7:15 PM
Ok, wanting your opinion first. The problem is that It's supposed to work with other libs not just Jackson so I guess it should be done somewhere in the renderer. I'll try to poke around.
d

dave

11/17/2020, 7:16 PM
There's a set of defaults for use specifically with Jackson. Think it's JacksonExt.kt or similar
r

Razvan

11/17/2020, 8:36 PM
I was thinking that OpenApi3ApiRenderer is the place as it's that specific specification that requires that. Just like another one I just saw as invalid and cannot be fixed with just a Jackson config:
required
list in an object schema must not be empty. It's Ok to not have the key but if you have it it must have at least one element.
6 Views