A specification-first approach authors an independent OpenAPI document before or alongside implementation, making the document an editable source of truth for the API. section 6.2.1 section 6.2.2
Choose the approach by weighing these practical consequences:
- Check implementation against the specification and prevent an API gateway from exposing undocumented extra operations. section 6.2.2
- Edit and discuss OpenAPI without setting up or deploying a development framework. section 6.2.2
- Prefer code-first when automatic alignment with implementation outweighs the risks of unnoticed changes, framework limitations, or early stack decisions. section 6.2.2
Describing a resource path
Begin an OpenAPI document while designing a resource such as /products. Define the path, lowercase HTTP operation, parameters, request body, response status, headers, content, schemas, and human-readable descriptions. section 6.9
Figure 6.6 When deciding between specification-first and code-first approaches, it’s essential to check the pros and cons of each approach in the context in which you work.
Compare specification-first and code-first trade-offs against the constraints of your team, delivery process, and API lifecycle. section 6.2.2

