Files
CFDivePlatform/openspec/changes/swagger-api-docs-completion/specs/swagger-public-api/spec.md
T
a620906209 95bafef52d chore:新增 swagger-api-docs-completion change 規劃
proposal / design / specs / tasks 全部就緒,21 tasks 待實作

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 00:45:15 +08:00

1.3 KiB
Raw Blame History

ADDED Requirements

Requirement: 公開端點 Swagger 文件及共用 Schema

app/Docs/PublicApiDoc.php SHALL 文件化所有無需認證的公開端點,並定義全域共用 Schema。

Scenario: 共用 Schema 定義完整

  • WHEN 執行 php artisan l5-swagger:generate
  • THEN 以下 Schema 出現在產生的 JSONDivingOfferReviewCourseSchedulePaginationMetaApiErrorResponse

Scenario: GET /api/diving-offers 文件化

  • WHEN 開啟 Swagger UI
  • THEN GET /diving-offers 端點顯示 query parametersqregiontagper_pagepage)及包含分頁 meta 的 response schema

Scenario: GET /api/diving-offers/{id} 文件化

  • WHEN 開啟 Swagger UI
  • THEN GET /diving-offers/{id} 端點顯示 path parameter id 及包含 cover_image_urlimages 陣列的 response schema404 response 亦有定義

Scenario: GET /api/diving-offers/{id}/reviews 文件化

  • WHEN 開啟 Swagger UI
  • THEN 端點顯示 sorthelpful/rating/newest)、pageper_page 參數;response 包含 summaryaverage、total、distribution)與分頁 meta

Scenario: GET /api/diving-offers/{id}/schedules 文件化

  • WHEN 開啟 Swagger UI
  • THEN 端點顯示 response 包含 CourseSchedule 陣列(id、date、period、capacity、booked_count、status