Contract-First Development is about making your intent clear across team members, external teams or 3-party systems. By using tools like OpenAPI (for synchronous interactions) or AsyncAPI (for asynchronous interactions), we can define our programming API clearly at the outset. We also update the "contract" before we implement changes to the code. Further benefits include:
So that everyone can be productive in parallel AND we can have strong guarantees of the resulting applications working together properly. Instead of UI development being blocked awaiting a working service to code against, UI and Service developers can work in parallel. Also, if you define the contract first when developing or changing API interfaces, you have a clearer "Definition of Done" and "Acceptance Criteria" for the work.
In case of synchronous interactions, basically HTTP and REST endpoints, OpenAPI provides many references:
In case of asynchronous interactions, very typical in Event-Driven Architectures or Messaging systems, AsyncAPI provides many references: