Skip to content

Update OpenAPI schema#9

Merged
masaya-osuga merged 14 commits intomainfrom
update-openapi-schema
Mar 2, 2026
Merged

Update OpenAPI schema#9
masaya-osuga merged 14 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
Copy link

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 syncs the Subject Service’s OpenAPI schema (and regenerated server stubs/types) with updates from dotto-typespec, including removal of several legacy resources and introduction of new subject listing filters plus syllabus retrieval.

Changes:

  • Updated openapi/openapi.yaml (removed Courses/DayOfWeekTimetableSlots/SubjectCategories, added Subjects list filters, Subject upsert, and Syllabus endpoint; updated schemas).
  • Regenerated generated/api.gen.go to match the new OpenAPI contract (new param binding, models, and routes).
  • Removed now-obsolete handlers/wiring for removed endpoints and updated server initialization/handler constructor accordingly.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
openapi/openapi.yaml Updates API contract: removes endpoints, adds required subject query filters, adds upsert + syllabus endpoint, updates schemas.
internal/handler/subject_category.go Removes SubjectCategory handlers (endpoint removed from spec).
internal/handler/subject.go Adapts subject list response shape; adds new handler stubs for upsert + syllabus.
internal/handler/handler.go Removes unused service dependencies from Handler and NewHandler.
internal/handler/day_of_week_timetable_slot.go Removes DayOfWeekTimetableSlot handlers (endpoint removed from spec).
internal/handler/course.go Removes Course handlers (endpoint removed from spec).
internal/handler/converter.go Updates Faculty mapping types; partially adapts Subject mapping to new schema (currently with TODO/placeholder values).
generated/api.gen.go Regenerated API types/routes/strict wrapper per updated OpenAPI.
cmd/server/main.go Removes initialization/wiring for removed repositories/services; updates handler construction.
.serena/project.yml Adds Serena configuration keys for symbol info budget / language backend.
Comments suppressed due to low confidence (2)

openapi/openapi.yaml:204

  • GET /v1/subjects marks all filter parameters (q, grade, courses, class, classification, semester, requirementType, culturalSubjectCategory) as required: true. This is a breaking change from the previous no-parameter list API and will cause requests without all parameters to be rejected by request validation. Please confirm this is intended; if these are optional filters, change them to required: false (and update generation) or provide defaults.
    get:
      operationId: SubjectsV1_detail
      description: 科目を詳細取得する
      parameters:
        - name: id
          in: path
          required: true
          description: 科目ID
          schema:
            type: string
      responses:
        '200':
          description: 科目の詳細
          content:
            application/json:
              schema:
                type: object
                properties:
                  subject:
                    $ref: '#/components/schemas/Subject'
                required:
                  - subject
      tags:
        - Subjects
    delete:
      operationId: SubjectsV1_delete
      description: 科目を削除する
      parameters:
        - name: id
          in: path
          required: true
          description: 科目ID
          schema:
            type: string
      responses:
        '204':
          description: There is no content to send for this request, but the headers may be useful.
      tags:
        - Subjects
  /v1/subjects/{id}/syllabus:
    get:
      operationId: SyllabusV1_detail
      description: シラバスを取得する
      parameters:
        - name: id
          in: path
          required: true
          description: 科目ID
          schema:
            type: string
      responses:
        '200':
          description: シラバス
          content:
            application/json:
              schema:
                type: object
                properties:
                  syllabus:
                    $ref: '#/components/schemas/Syllabus'
                required:
                  - syllabus
      tags:
        - Syllabus
components:
  schemas:
    DottoFoundationV1.Class:
      type: string
      enum:
        - A
        - B
        - C
        - D
        - E
        - F
        - G

openapi/openapi.yaml:228

  • For PUT /v1/subjects the operation is described as upsert (create or update), but the 200 response description still says "作成された科目" (created subject). Please update the response description to reflect both create and update outcomes to avoid confusing API consumers.
      type: string
      enum:
        - AllYear
        - H1
        - H2
        - Q1
        - Q2
        - Q3

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@masaya-osuga
Copy link
Member

Copilotの指摘みるわ

Copy link

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 10 out of 11 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@kantacky kantacky left a comment

Choose a reason for hiding this comment

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

一旦、レビューしたことにします
Copilotコメントの対応が完了したら、再レビュー依頼お願いします

@masaya-osuga masaya-osuga requested a review from kantacky March 2, 2026 06:10
@masaya-osuga
Copy link
Member

Copilotの指摘は正しいのですが、次のPRで実装いたします。

Copy link
Member

@kantacky kantacky left a comment

Choose a reason for hiding this comment

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

LGTM

@masaya-osuga masaya-osuga merged commit dbc35aa into main Mar 2, 2026
1 check passed
@masaya-osuga masaya-osuga deleted the update-openapi-schema branch March 2, 2026 06:45
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