by paholg · 2y ago · 0 comments
I've been using a tool to generate OpenApi from code, and am pretty happy with that workflow. Even if writing the API before logic, I'd much rather write the types and endpoints in a real programming language, and just have a `todo` in the body.
You can still write API-driven code without literally writing OpenApi first.
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.
Sadly, there is a distinct lack of tools to make spec-first development easier. At the moment, Stoplight [0] is the only game in town as a high quality schema editor, but it requires payment for any more significant usage.
At least for people comfortable with doing test driven development.
Write your requirements for your API-driven code as tests first, then document those APIs by running the tests through this tool.
I'm using aide for a Rust/Axum server: https://github.com/tamasfe/aide