Documentation

Rethinking RESTful API Development: From Schema-First to API Genie

Andriy Mykulyak
#rest#api#openapi#schema-driven#analysis

TL;DR;

Schema-first development, despite its advantages, hasn’t become mainstream. We’ve been optimizing it for centralized, public APIs. Fortunately, API Genie adapts this workflow for mainstream scenarios (internal APIs developed by independent, cross-functional teams), while preserving its benefits.

Introduction

API development is crucial in modern software architecture.

Approaches to development of RESTful APIs

When developing RESTful APIs, four main approaches are available: schema-less, code-first, schema-first, and design-first. Let’s review each, discussing their advantages and weaknesses.

Schema-less

Developers don’t create a formal API contract. They start coding after collecting business requirements.

Advantages:

Weaknesses:

Best for:

Code-first

The API contract is created from backend code. Annotations are often used to generate the contract.

Advantages:

Weaknesses:

Best for:

Schema-first

A formal contract serves as the single source of truth. The API implementation must conform to the contract.

Advantages:

Weaknesses:

Best for:

Design-first

Similar to schema-first, but with more emphasis on design. Advanced mocking and testing enable high-quality API development without writing code.

Advantages:

Weaknesses:

Best for:

Challenges of Schema-first Approach

Despite its advantages, schema-first hasn’t become mainstream. Why?

  1. Optimized for the wrong scenario:
  1. Migration difficulties:
  1. Code generation issues:
  1. Schema consistency:

How API Genie is different

API Genie addresses these challenges by:

Stay tuned for our upcoming series exploring API Genie’s modules in depth.

← Back to Blog