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
Attempt Servicecontracts/openapi/services/attempt-service.yaml
Auth Servicecontracts/openapi/services/auth-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
Question Bank Servicecontracts/openapi/services/question-bank-service.yaml
School Servicecontracts/openapi/services/school-service.yaml
User Servicecontracts/openapi/services/user-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.