1.7 KiB
Contract standard
The repository has separate public and internal OpenAPI contracts:
- api/core/openapi.yml describes browser-to-Go operations.
- api/ml/openapi.yml describes internal Go-to-ML operations.
Edit the split source files referenced by these roots. Use the API Makefile to merge schemas, bundle, and lint both specifications. Do not hand-edit bundled files.
The selected Go server generator is ogen. The generated Go handler is mounted under chi. Orval generates the TypeScript client and related frontend artifacts. The Go ML client is configured in backend/codegen/ogen-ml.yml and generated into backend/internal/adapter/secondary/ml/api/. datamodel-code-generator uses ml/codegen/pyproject.toml to generate Pydantic v2 models in ml/src/lincodex_ml/api/models.py from the ML bundle. There are three code generation unit directories: backend/codegen/, frontend/codegen/, and ml/codegen/. Each consumer owns the configuration for its generated code; contract sources remain shared under api/.
OpenAPI 3.2.0 is the target contract version. Verify only the feature subset used by this repository through the pinned bundler, linter, ogen, Go runtime path, Orval, Python Pydantic models, and documentation pipeline. A passing fixture does not establish full support for every OpenAPI 3.2 feature. Record the exact checks run.
Runtime validation and generated types do not implement authentication, object authorization, consent, or valid product state transitions. Keep those checks in the appropriate application layer.
When a contract changes, regenerate every affected consumer from the same source and run generated drift checks. Report if a consumer or generation step was not verified.