Skip to content

Update OpenAPI schema#14

Merged
kantacky merged 11 commits intomainfrom
update-openapi-schema
Mar 2, 2026
Merged

Update OpenAPI schema#14
kantacky merged 11 commits intomainfrom
update-openapi-schema

Conversation

@dotto-api-schema-updater
Copy link
Contributor

@dotto-api-schema-updater dotto-api-schema-updater bot commented Feb 19, 2026

This PR updates the OpenAPI schema from dotto-typespec.

Triggered by: fun-dotto/dotto-typespec@0d0bdb6

@kantacky kantacky linked an issue Feb 20, 2026 that may be closed by this pull request
@hikaru-0602
Copy link
Contributor

とりあえずここからブランチ切って作業します

@kantacky kantacky marked this pull request as draft March 1, 2026 14:31
Copy link
Contributor

@hikaru-0602 hikaru-0602 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@hikaru-0602 hikaru-0602 marked this pull request as ready for review March 2, 2026 04:58
Copilot AI review requested due to automatic review settings March 2, 2026 04:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@hikaru-0602 hikaru-0602 marked this pull request as draft March 2, 2026 06:01
* コースを削除

* 時限を削除

* 科目区分を削除

* 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>
@kantacky kantacky marked this pull request as ready for review March 2, 2026 08:41
Copilot AI review requested due to automatic review settings March 2, 2026 08:41
@kantacky kantacky enabled auto-merge (squash) March 2, 2026 08:42
@kantacky kantacky merged commit 312d0f8 into main Mar 2, 2026
1 check passed
@kantacky kantacky deleted the update-openapi-schema branch March 2, 2026 08:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +665 to 666
/v1/timetable/itmes:
get:
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/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.

Copilot uses AI. Check for mistakes.
explode: false
- name: dayOfWeek
in: query
required: true
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
required: true
required: false

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +25
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,
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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,

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +14
// CourseRegistrationsV1List 履修情報を取得する
func (h *Handler) CourseRegistrationsV1List(c *gin.Context, params api.CourseRegistrationsV1ListParams) {
c.JSON(http.StatusNotImplemented, gin.H{"error": "not implemented"})
}
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

スキーマ変更取り込み (複数教員、単位数)

3 participants