Skip to content

Update OpenAPI schema#17

Merged
masaya-osuga merged 4 commits intomainfrom
update-openapi-schema
Mar 19, 2026
Merged

Update OpenAPI schema#17
masaya-osuga merged 4 commits intomainfrom
update-openapi-schema

Conversation

@dotto-api-schema-updater
Copy link
Contributor

This PR updates the OpenAPI schema from dotto-typespec.

Triggered by: fun-dotto/dotto-typespec@50b5e77

@kantacky kantacky assigned kantacky and masaya-osuga and unassigned kantacky Mar 19, 2026
@masaya-osuga masaya-osuga marked this pull request as ready for review March 19, 2026 14:22
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

Copy link
Member

@masaya-osuga masaya-osuga left a comment

Choose a reason for hiding this comment

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

マージする

@masaya-osuga masaya-osuga merged commit 9c6ef95 into main Mar 19, 2026
4 checks passed
@masaya-osuga masaya-osuga deleted the update-openapi-schema branch March 19, 2026 14:26
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 syncs this repository’s OpenAPI contract and generated server types with the latest upstream dotto-typespec changes, and updates several handlers to return newly-defined 4xx responses for not-found / bad-request cases.

Changes:

  • Added new 400 / 404 responses to multiple endpoints in openapi/openapi.yaml.
  • Regenerated generated/api.gen.go to include corresponding typed response structs for those new status codes.
  • Updated several handlers to translate gorm.ErrRecordNotFound into the newly-generated 404 responses (and 400 for Subjects upsert).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openapi/openapi.yaml Adds new 4xx response entries (400/404) to match upstream schema changes.
internal/handler/syllabus_detail.go Returns typed 404 response on gorm.ErrRecordNotFound.
internal/handler/subject_upsert.go Returns typed 400 response on gorm.ErrRecordNotFound (noted in review).
internal/handler/subject_detail.go Returns typed 404 response on gorm.ErrRecordNotFound.
internal/handler/subject_delete.go Returns typed 404 response on gorm.ErrRecordNotFound.
internal/handler/faculty_update.go Returns typed 404 response on gorm.ErrRecordNotFound.
internal/handler/faculty_detail.go Returns typed 404 response on gorm.ErrRecordNotFound.
internal/handler/faculty_delete.go Returns typed 404 response on gorm.ErrRecordNotFound.
generated/api.gen.go Adds generated response structs/visitors for the new 400/404 responses.

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

You can also share your feedback on Copilot code review. Take the survey.

subject, err := h.subjectSvc.Upsert(ctx, request.Body.SyllabusId)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return api.SubjectsV1Upsert400Response{}, nil
Comment on lines +54 to +55
'404':
description: The server cannot find the requested resource.
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