Hacker News new | ask | show | jobs
by yupyupyups 199 days ago
You should add OpenAPI generation. So that basically the endpoint /openapi.json is auto-generated.
2 comments

Like most thing in web development, this is backwards. Applications should be generated from the spec, not the other way around.
Care to explain the advantage of starting off with the spec rather than with code?
Because, you can iterate on the spec with all the stakeholders without ever writing a line of business logic. There are tools which can create a dummy web server from the specification and you can build clients without implementing business logic. I thought the advantages of spec-first development are obvious but I hope I helped.
Thanks. The advantages of having a spec is obvious to me as well. I'm just not sure why building business logic that generates the spec (that generates the client) is a bad idea. That way you still have a single source of truth, and a spec.
related - someone should take a stab at actually finishing this :) https://github.com/drogonframework/drogon/issues/988