Comment on Show HN: Auto-generate an OpenAPI spec by listening to localhostparentComments−rad_gruchalski2yYou can write an OpenAPI spec in JSON. You can use Jsonnet to generate your spec from whatever input you need.−madeofpalk2yJSON is a different kind of yuck to have to author by hand, especially in the volume an api spec tends to be.−refulgentis2yI don't like writing structured formats by hand either - at some point, you either need to, as they say in France, split or get off your seatEither don't write it by hand, i.e. use a generator for the structured format, as the comments advocate for and article is about.Or, just say you'll never have a spec.−rad_gruchalski2yYes, so use Jsonnet or generate it from some intermediate representation using some alternative method. What’s the problem?−paholg2yWhy though when I can just generate it from my actual code and not have to maintain two copies of my api spec?−lttlrck2yJsonnet introduces another (flawed) language?
Comments
You can write an OpenAPI spec in JSON. You can use Jsonnet to generate your spec from whatever input you need.
JSON is a different kind of yuck to have to author by hand, especially in the volume an api spec tends to be.
I don't like writing structured formats by hand either - at some point, you either need to, as they say in France, split or get off your seat
Either don't write it by hand, i.e. use a generator for the structured format, as the comments advocate for and article is about.
Or, just say you'll never have a spec.
Yes, so use Jsonnet or generate it from some intermediate representation using some alternative method. What’s the problem?
Why though when I can just generate it from my actual code and not have to maintain two copies of my api spec?
Jsonnet introduces another (flawed) language?