openapi: 3.1.0 info: title: Api version: 0.1.0 description: 鉄道遅延マップ API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: delays description: 鉄道遅延情報 paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /delays: get: operationId: getDelays tags: [delays] summary: 遅延情報一覧を取得 description: 現在の遅延情報を一覧で返す responses: "200": description: 遅延情報一覧 content: application/json: schema: type: array items: $ref: "#/components/schemas/DelayInfo" /delays/ranking: get: operationId: getDelayRanking tags: [delays] summary: 遅延ランキングを取得 description: 遅延頻度・深刻度でソートされたランキングを返す parameters: - name: type in: query required: false description: ランキングタイプ (station または line) schema: type: string - name: limit in: query required: false description: 取得件数 schema: type: integer responses: "200": description: ランキング情報 content: application/json: schema: type: array items: $ref: "#/components/schemas/DelayRankingItem" /delays/fetch: post: operationId: fetchLatestDelays tags: [delays] summary: 最新の遅延情報を取得・保存する description: 外部APIから最新の遅延情報を取得してDBに保存する responses: "200": description: 取得結果 content: application/json: schema: $ref: "#/components/schemas/FetchResult" components: schemas: HealthStatus: type: object properties: status: type: string required: - status DelayInfo: type: object properties: id: type: integer lineName: type: string lineNameKana: type: ["string", "null"] companyName: type: string stationName: type: ["string", "null"] cause: type: ["string", "null"] delayMinutes: type: ["integer", "null"] status: type: string description: type: ["string", "null"] lat: type: ["number", "null"] lng: type: ["number", "null"] source: type: string fetchedAt: type: string format: date-time required: - id - lineName - companyName - status - source - fetchedAt DelayRankingItem: type: object properties: rank: type: integer name: type: string type: type: string companyName: type: string delayCount: type: integer avgDelayMinutes: type: ["number", "null"] maxDelayMinutes: type: ["integer", "null"] lat: type: ["number", "null"] lng: type: ["number", "null"] recentCauses: type: array items: type: string required: - rank - name - type - companyName - delayCount FetchResult: type: object properties: success: type: boolean fetchedCount: type: integer message: type: string required: - success - fetchedCount - message