-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Design-first Article #306
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for bump-content-hub ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
1. **Readable by humans and machines**: The YAML/JSON format means it's clear for developers and allows for API design reviews / governance with teams that don't have to read multiple programming languages. | ||
2. **Interactive docs**: API Documentation generators like Bump.sh turn OpenAPI documents into interactive documentation, showing off parameters and examples, so clients can quickly and easily work with the API. | ||
3. **Mock servers**: Tools like Microcks and Wiretap can use the OpenAPI document to simulate the API, allowing parallel development of API and client applications, and allowing feedback to come in early and often. | ||
4. **Server-side Validation**: Instead of rewriting all of your validation logic in docs and code, you can use the OPenAPI document to power your application, making absolute certain the the documentation matches the implementation and reducing time spent writing code. | ||
5. **Contract Testing**: Use automated tools to probe your API implementation based off the OpenAPI document, and add assertions to existing test suites saying "does this response match what it says in OpenAPI", further ensuring the two are in agreement and saving time writing complicated contract testing by hand. | ||
6. **Code generation**: Many tools generate client libraries or server stubs directly from an OpenAPI document, saving loads of time. | ||
7. **API Style Guides**: Style guides are hard to enforce against code, developers need to check them manually, but with OpenAPI you can enforce standards on the API from the very first endpoint that is described. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great section! I would add as many links as possible to our existing guides.
Thanks @philsturgeon ! It needed an update indeed. I would love if we can still make it as "agnostic" as possible (not stick to only OpenAPI). Also, it would be great to give guidance on a good API Design-first process, such as James' ADDR. |
@ChristopheDujarric the previous guide was good, but it conflated API Design-first and API-first design.
One of the most confusing things in the world of APIs is that these are two fundamentally different concepts...
I have focused entirely on API Design-first here, but would be happy to take a quick stab at what API-first means for the sake of SEO and telling a complete story. It could be a paragraph.
Other than that, this could definitely be better, go in deeper, have more diagrams, etc. Just wanted to fire it over as I'm on 4 hours with it already and want to make sure I get the right direction.