# API Development Workflow
1-Design 2-Develop 3-Code Review 4-QA on Staging 5-Production Deployment 6-QA on Production
- Draft Design the API First (ideally during Grooming, but can also be during starting working on the US/bug)
Analyze business requirements
Identify affordances
e.g.: Create user, Submit payment, Search for a deck
Identify resources
e.g.: User, Card, Deck
Identify relations
e.g.: User has many Decks via curation relation, all of the required affordances should be mapped to relations.
Formalize the design in the Open API Specification (opens new window) (OAS, formerly known as "Swagger") version 2.x or 3.0.x format.
- Use Stoplight (opens new window) for the whole design process to the publication of the API specification.
- Create a new version from the
main
version of the API on stoplight:
Follow the API Guidelines
- See Principles & Conventions sections.
- Make sure to provide enough description about:
- What is the endpoint about?
- Why is the endpoint created?
- How in general would the endpoint accomplish that?
- If there are parameters, make sure have them described.
- Make sure to provide list of possible errors.
Review the Endpoint Design
Comment the link to the finalized Design to US/bug on Target Process.
Publish the finalized Draft Design to Slack channel #api-design-first.
- The slack message should notify everyone so that everyone has a chance to feedback on the design.
- There is a link to the Feature/US/bug.
- This is a link to the finalized Draft Design on Stoplight.
- A brief description of what changes was made to the Endpoint or if this is a new Endpoint.
- Develop the API
- Check out finalized Draft Design from Stoplight.
- Set up Integration Test Cases to make sure all cases mentioned in the Design are covered (error responses, status codes...).
- Set up Integration Test Cases for the Endpoint as normal development.
- Implement the Endpoint.
- Properly add decorators for the Endpoint.
- The decorators is the single source of truth of API Documentation. Everything else (Swagger file, API Documentation deployed on Redoc, Stoplight...) are just deprived versions from the decorators.
- Code Review
- See here for API Doc Code Review process.
- Code Reviewer(s) compare the implementation with the original Draft Design.
- Code Reviewer(s) continue evaluating the Endpoint and discuss to ensure the end result is satisfying.
- QA Verification on Staging
- QA(s) verify the outputted endpoint and API Doc.
- QA(s) compare the implementation with the original Draft Design.
- QA(s) continue evaluating the Endpoint and discuss to ensure the end result is satisfying.
- QA(s) get final confirmation of the finalized implement Endpoint with Product if needed.
- Production Deployment
- The endpoint and API Doc is automatically deployed to Production through the Production Development Pipeline.
- Pipeline auto push latest swagger file to Stoplight to used for next round of API Design First.
- QA Verification on Production