Skip to content

OpenAPI Contracts

Native Go-platform OpenAPI contracts live in the repository under contracts/openapi. They are intentionally kept outside the VitePress docs tree because the YAML files are build inputs for generated clients and service validation.

Contract Files

ContractRepository path
API Gatewaycontracts/openapi/api-gateway.yaml
Admin Servicecontracts/openapi/services/admin-service.yaml
AI Classifier Servicecontracts/openapi/services/ai-classifier-service.yaml
Analytics Servicecontracts/openapi/services/analytics-service.yaml
Audit Servicecontracts/openapi/services/audit-service.yaml
Attempt Servicecontracts/openapi/services/attempt-service.yaml
BFF Servicecontracts/openapi/services/bff-service.yaml
IAM Servicecontracts/openapi/services/iam-service.yaml
Classroom Servicecontracts/openapi/services/classroom-service.yaml
Course Servicecontracts/openapi/services/course-service.yaml
Document Servicecontracts/openapi/services/document-service.yaml
DOCX Import Servicecontracts/openapi/services/docx-import-service.yaml
Exam Servicecontracts/openapi/services/exam-service.yaml
Notification Servicecontracts/openapi/services/notification-service.yaml
Billing Servicecontracts/openapi/services/billing-service.yaml
Usage Servicecontracts/openapi/services/usage-service.yaml
Payment Servicecontracts/openapi/services/payment-service.yaml
Question Bank Servicecontracts/openapi/services/question-bank-service.yaml
School Servicecontracts/openapi/services/school-service.yaml
Profile Servicecontracts/openapi/services/profile-service.yaml
Search Servicecontracts/openapi/services/search-service.yaml
Wallet Servicecontracts/openapi/services/wallet-service.yaml

Frontend Client Generation

Browser-facing code should generate from the gateway contract only:

bash
pnpm frontend:generate-api

That command writes the API Gateway client types to packages/api-client/src/generated/api-gateway.ts.

Service contracts are for internal service validation, gateway adapter work, migration tooling, and focused service tests. Do not generate public browser clients from every native service contract unless that service is explicitly promoted to a public BFF surface.

Promotion Rule

A route cannot move out of legacy_proxy until these artifacts are aligned:

  1. Legacy route evidence and request/response examples.
  2. Native OpenAPI path and schema.
  3. Gateway route-table mapping.
  4. Auth, tenant, envelope, validation, and SSE parity notes.
  5. Unit, adapter, parity, browser/runtime, and rollback evidence.

Go-platform documentation is generated from repository Markdown.