3 ms·
For HTTP APIs, I'm a full convert to OpenAPI - write your API document by hand, then code-gen the client/server stubs. It requires a small investment upfront,
by avinium 7y ago
For HTTP APIs, I'm a full convert to OpenAPI - write your API document by hand, then code-gen the client/server stubs.
It requires a small investment upfront, but will pay huge dividends once your project is rolling. You have a single source of truth for publicly exposed endpoints and model descriptions (your API document), and you can instantly regenerate certain key components (e.g. model binding, new routes, etc) whenever that document changes.
I actually contributed the F#/Giraffe generator to the OpenAPI generator project, which you can find at https://github.com/OpenAPITools/openapi-generator https://github.com/OpenAPITools/openapi-generator