Skip to content

Design First or Code First Approach | SmartBear Support | SmartBear Software

Source: Design First or Code First Approach | SmartBear Support | SmartBear Software

Excerpt

Design first API development is used when the goal is to design and document an API prior to writing the back-end code to support it. In Code first API development, on the other hand, the API documentation is often generated based on an existing API endpoint. Each method has pros and cons, but regardless of method SwaggerHub can help.

Design First or Code First API Development

Design first API development is used when the goal is to design and document an API prior to writing the back-end code to support it. In Code first API development, on the other hand, the API documentation is often generated based on an existing API endpoint. Each method has pros and cons, but regardless of method SwaggerHub can help.

By designing the API’s contract before writing any code, the Design First approach can make sure your team is aligned through the design process even before coding begins. SwaggerHub assists here by letting teams use Domains to easily use common components across multiple API definitions (don’t worry, they’re covered more in depth in the Advanced Topics), and customize code generation options for server stubs and client SDKs.

Code First API Design is the more traditional approach and has its own benefits. For example, by coding directly from requirements APIs can sometimes be implemented faster. SwaggerHub allows you to create API documentation by importing existing APIs.

Swagger.io has a lot of resources on this topic, including the blog post Design First or Code First: What’s the Best Approach to API Development? Now that you’re familiar with these two approaches, we’ll move on to creating APIs (the Design First approach) and importing APIs (Code First approach).

Video Thumbnail


  • [[Markdownloads]]

Jimmy Briggs | 2022