Skip to content

api-datamodelTurn backend endpoints into business APIs

Use Services to unify boundaries, request rules, and types so application code depends only on stable business capabilities.

Core Model ​

text
Backend API
     ↓
  Service
     ↓
Business API
     ↓
Application Code

A Service defines the service boundary, while business APIs expose concrete capabilities:

ts
await userApi.list({ page: 1 })
await orderApi.submit(data)

Application code no longer assembles URLs or repeatedly handles the same request rules.

Already Have OpenAPI? ​

Codegen supports API modeling and produces the same kind of business API:

text
OpenAPI → API Codegen → TypeScript Types + Business APIs

Start with the Introduction to understand the model, or go directly to API Codegen if you already have OpenAPI.