anttiviljami
Joined 11 years ago
Joined 11 years ago
Code should not inform design.
Design informs code.
But I’d always advocate for going schema first. This has huge benefits for collaboration between frontend and backend engineers and results in better designed APIs and generally better software in my experience.
Wrote a full blog post some time ago explaining why the API First approach works: https://dev.to/epilot/why-we-design-apis-first-e85
Totally agree.
GraphQL tooling is generally just better. It enforces a Schema first workflow and thus more emphasis on conventions and design.
OpenAPI tends to be an after thought with teams building REST APIs. Swagger started out as a way to add docs and generate SDKs.
That was exactly my motivation for building openapi-stack. GraphQL-like tooling, but for teams using REST.
The nice thing is you already have an openapi spec, so it’s pretty trivial to eject from fastify swagger and switch to openapi-backend if you want!
Here’s an example of openapi-backend running on Fastify
https://github.com/openapistack/openapi-backend/tree/main/ex...
Supporting nested queries isn’t really a common thing in REST, and it’s simpler to rate limit clients by resource than query complexity.
It’s not like HTTP is going to go away in a while.
I find that AsyncAPI is a nice extension of OpenAPI/REST ideas if you need to go beyond request / response.
[ my public key: https://keybase.io/anttiviljami; my proof: https://keybase.io/anttiviljami/sigs/t1R43rnvDVkV9HdB5wRu8bVo9DqubY9dd9LrjQZBHkM ]