Conversation
924a9c3 to
eb9f560
Compare
|
とりあえずここからブランチ切って作業します |
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s OpenAPI specifications (and corresponding generated Go code) to match the latest changes from dotto-typespec, including splitting Faculty APIs into a dedicated external spec and expanding the Subject external API with new filtering and syllabus retrieval.
Changes:
- Updated core OpenAPI schema (
openapi/openapi.yaml) by removing deprecated endpoints (courses / timetable slots / subject categories) and revising Subject/Faculty schemas. - Updated external Subject Service OpenAPI (
openapi/external/subject_api/openapi.yaml) to add rich list filtering, change create/update semantics to an upsert, and add a syllabus endpoint. - Added a new external Faculty Service OpenAPI (
openapi/external/faculty_api/openapi.yaml) and updated generated Go client/server bindings.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| openapi/openapi.yaml | Removes deprecated paths/tags and updates Subject/Faculty schema references and shapes. |
| openapi/external/subject_api/openapi.yaml | Redefines Subject external API (filters, upsert, syllabus) and schema types. |
| openapi/external/faculty_api/openapi.yaml | Introduces a dedicated Faculty external API spec. |
| generated/external/subject_api/client.gen.go | Regenerates the Subject external Go client, reflecting new endpoints and params (but currently inconsistent with the spec). |
| generated/api.gen.go | Regenerates Go server bindings for the main API (but currently inconsistent with the updated OpenAPI schema). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* コースを削除 * 時限を削除 * 科目区分を削除 * Facultyを更新 * Subjectを更新 * 名前修正 * スキーマ更新 * task generate * Update internal/handler/subject.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor SubjectsV1List to simplify parameters by passing nil instead of an empty struct * FacultyのURL追加 * TaskfileにFaculty追加 * FacultyのConfig追加 * Facultyのクライアント生成処理追加 * Adminのtask generate * Facultyのtask generate * Subjectのtask generate * Handlerの初期化にFaculty追加 * FacultyのHandler実装 * SubjectのHandler実装 * main修正 * Update internal/handler/subject.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Adminのtask generate * Facultyのtask generate * Subjectのtask geenrate * Announcementのスキーマ変更に伴う修正 * Facultyのスキーマ変更に伴う修正 * Subjectのスキーマ変更に伴う修正 * インターフェース満たすために簡易実装 * クエリを変換する処理 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 20 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /v1/timetable/itmes: | ||
| get: |
There was a problem hiding this comment.
/v1/timetable/itmes / {id} looks like a typo ("itmes" vs "items"). This will bake an incorrect path into the generated server/client code and is hard to change later without breaking consumers; please confirm and rename to /v1/timetable/items if unintentional.
| explode: false | ||
| - name: dayOfWeek | ||
| in: query | ||
| required: true |
There was a problem hiding this comment.
The dayOfWeek query parameter is marked required: true, but its description says "指定しない場合は全ての曜日が選択される" (i.e., optional). Either make it optional (required: false) or update the description so the contract is consistent.
| required: true | |
| required: false |
| Q: params.Q, | ||
| Grade: convertSlicePtr[api.DottoFoundationV1Grade, subject_api.DottoFoundationV1Grade](params.Grade), | ||
| Courses: convertSlicePtr[api.DottoFoundationV1Course, subject_api.DottoFoundationV1Course](params.Courses), | ||
| Class: convertSlicePtr[api.DottoFoundationV1Class, subject_api.DottoFoundationV1Class](params.Class), | ||
| Classification: convertSlicePtr[api.DottoFoundationV1SubjectClassification, subject_api.DottoFoundationV1SubjectClassification](params.Classification), | ||
| Year: params.Year, |
There was a problem hiding this comment.
SubjectSubjectsV1List accepts semester, requirementType, and culturalSubjectCategory in api.SubjectSubjectsV1ListParams, but these are not forwarded into subject_api.SubjectsV1ListParams. As a result, those filters will be silently ignored by the BFF; map the missing fields (and any other list params) into clientParams before calling the upstream client.
| Q: params.Q, | |
| Grade: convertSlicePtr[api.DottoFoundationV1Grade, subject_api.DottoFoundationV1Grade](params.Grade), | |
| Courses: convertSlicePtr[api.DottoFoundationV1Course, subject_api.DottoFoundationV1Course](params.Courses), | |
| Class: convertSlicePtr[api.DottoFoundationV1Class, subject_api.DottoFoundationV1Class](params.Class), | |
| Classification: convertSlicePtr[api.DottoFoundationV1SubjectClassification, subject_api.DottoFoundationV1SubjectClassification](params.Classification), | |
| Year: params.Year, | |
| Q: params.Q, | |
| Grade: convertSlicePtr[api.DottoFoundationV1Grade, subject_api.DottoFoundationV1Grade](params.Grade), | |
| Courses: convertSlicePtr[api.DottoFoundationV1Course, subject_api.DottoFoundationV1Course](params.Courses), | |
| Class: convertSlicePtr[api.DottoFoundationV1Class, subject_api.DottoFoundationV1Class](params.Class), | |
| Classification: convertSlicePtr[api.DottoFoundationV1SubjectClassification, subject_api.DottoFoundationV1SubjectClassification](params.Classification), | |
| Semester: params.Semester, | |
| RequirementType: params.RequirementType, | |
| CulturalSubjectCategory: params.CulturalSubjectCategory, | |
| Year: params.Year, |
| // CourseRegistrationsV1List 履修情報を取得する | ||
| func (h *Handler) CourseRegistrationsV1List(c *gin.Context, params api.CourseRegistrationsV1ListParams) { | ||
| c.JSON(http.StatusNotImplemented, gin.H{"error": "not implemented"}) | ||
| } |
There was a problem hiding this comment.
These stub endpoints return 501 Not Implemented without enforcing the same authorization checks used elsewhere (e.g., RequireAnyClaim("admin", "developer")). This both widens access (any authenticated user can hit them) and makes the runtime behavior diverge from the OpenAPI spec (which doesn't document 501). Either implement the handlers, remove the routes from the spec until implemented, or at least add the same claim checks and document the 501 response in the spec.
This PR updates the OpenAPI schema from dotto-typespec.
Triggered by: fun-dotto/dotto-typespec@0d0bdb6