Hi. Does Http4k actually generate the `openapi.yml...
# http4k
a
Hi. Does Http4k actually generate the
openapi.yml
file somewhere? If not, is it possible to make it to do so?
d
it's purposely dynamic in order that you can generate it at runtime. For the times when we actually need it, we always just write a test which calls the openapi endpoint and outputs the content to a file somewhere. A lot of the time we use this for approval testing (to lock in the contract) and to export it for other uses like generating clients etc...
💯 2
a
Thanks, Dave. I'll give it a try then.
The
openapi
is in the
json
format. Is there a way, out-of-the-box to have it as
yaml
?
d
sorry - you'll need to convert it manually to what is undoubtedly a worse format 😉 . Should be easy in a test though - you can use jackson YAML and jackson JSON to do it