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:
@@ -1,4 +1,5 @@
|
||||
spring.application.name=fete
|
||||
server.servlet.context-path=/api
|
||||
|
||||
management.endpoints.web.exposure.include=health
|
||||
management.endpoint.health.show-details=never
|
||||
|
||||
37
backend/src/main/resources/openapi/api.yaml
Normal file
37
backend/src/main/resources/openapi/api.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: fete API
|
||||
description: Privacy-focused event announcements and RSVPs
|
||||
version: 0.1.0
|
||||
license:
|
||||
name: GPL-3.0-or-later
|
||||
identifier: GPL-3.0-or-later
|
||||
|
||||
servers:
|
||||
- url: /api
|
||||
|
||||
paths:
|
||||
/health:
|
||||
get:
|
||||
operationId: getHealth
|
||||
summary: Health check
|
||||
tags:
|
||||
- health
|
||||
responses:
|
||||
"200":
|
||||
description: Service is healthy
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/HealthResponse"
|
||||
|
||||
components:
|
||||
schemas:
|
||||
HealthResponse:
|
||||
type: object
|
||||
required:
|
||||
- status
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
example: UP
|
||||
Reference in New Issue
Block a user