Is there a way to take an existing openapi spec and use that to implement a server in http4k? I see that the OpenApi module encourages generating the spec from the code, but is there a way to do it the other way around?
@Arnab note that the toolbox is quite picky on the interpretation of the spec (it requires that is is valid), so the result you get may either be incomplete or not work at all.
This mostly depends on if the spec is valid (a lot of them aren't) or was hand rolled or contains features that aren't representable in simple generation.
dave
05/26/2025, 8:57 AM
Alternatively, an AI assistant may do apretty good job. 🙃
a
Arnab
05/26/2025, 9:51 AM
Eh yeah maybe AI 🤔 The question isn't so much about generating the code though. I was mostly wondering if this workflow of having a spec, and then writing code that is compliant, is supported. I guess the answer is "yes, but it is quite strict"?