schema-openapi
schema-openapi copied to clipboard
Feature request: render to openapi doc string
It would be really useful to be able to generate a string of the openapi document. :)
Hey, not sure I understand. Do you mean literally to stringify the openapi spec?
That's what I was thinking at the time but I was probably a bit sleep deprived.. jaja I think as json would be better. I can see that the /docs http page has a link to download the json but I'm not seeing a fn in this lib. I'm probably missing it though.. Basically I'm looking for a way to write the generated openapi schema to a file(in yaml but the 'yaml' package could handle json -> yaml)
In the effect-http
I simply call ServerResponse.json and the impl of the encoding is in the @effect/platform/internal/http/body - so basically it's JSON.stringify
. I think the openapi spec will be generally small enough so that one don't need to bother with streaming it somehow and you can simply stringify the whole thing and write it to a file.