T-5: set up API-first tooling with OpenAPI spec as single source of truth

Backend: openapi-generator-maven-plugin generates Spring interfaces and DTOs
from the spec. Frontend: openapi-typescript + openapi-fetch provide type-safe
API access. Both sides get compile-time contract enforcement from a single
api.yaml file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 18:04:55 +01:00
parent 1ed379bc1c
commit 5ad6a08b72
9 changed files with 388 additions and 10 deletions

View File

@@ -4,8 +4,9 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"generate:api": "openapi-typescript ../backend/src/main/resources/openapi/api.yaml -o src/api/schema.d.ts",
"dev": "npm run generate:api && vite",
"build": "npm run generate:api && run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"build-only": "vite build",
@@ -16,6 +17,7 @@
"format": "prettier --write --experimental-cli src/"
},
"dependencies": {
"openapi-fetch": "^0.17.0",
"vue": "^3.5.29",
"vue-router": "^5.0.3"
},
@@ -35,6 +37,7 @@
"jiti": "^2.6.1",
"jsdom": "^28.1.0",
"npm-run-all2": "^8.0.4",
"openapi-typescript": "^7.13.0",
"oxlint": "~1.50.0",
"prettier": "3.8.1",
"typescript": "~5.9.3",