Skip to content

Update OpenAPI schema#16

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

Update OpenAPI schema#16
kantacky merged 2 commits intomainfrom
update-openapi-schema

Conversation

@dotto-api-schema-updater
Copy link
Copy Markdown
Contributor

This PR updates the OpenAPI schema from dotto-typespec.

Triggered by: fun-dotto/dotto-typespec@1ed56ee

@kantacky kantacky self-assigned this Mar 25, 2026
Copy link
Copy Markdown

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 contract (synced from dotto-typespec) and adjusts the frontend to match API shape changes, notably the move from dayOfWeek/period fields to a nested slot object and the shift from semester to semesters[] query parameters.

Changes:

  • Update openapi/openapi.yaml with new endpoints/schemas and pluralized query parameters (e.g., semesters, grades, classes).
  • Update timetable UI components to read/write TimetableItem.slot instead of dayOfWeek / period.
  • Update server actions to send semesters: [semester] for affected GET endpoints.

Reviewed changes

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

Show a summary per file
File Description
src/components/timetable/TimetableItemTable.tsx Read weekday/period from item.slot with a fallback when missing
src/components/timetable/TimetableItemForm.tsx Submit timetable item creation using { slot: { dayOfWeek, period } }
src/components/timetable/TimetableItemDeleteDialog.tsx Display deletion description using item.slot
src/app/dotto/timetable/actions.ts Update timetable list query param from semester to semesters[]
src/app/dotto/course-registrations/actions.ts Update registrations list query param from semester to semesters[]
openapi/openapi.yaml Sync OpenAPI changes: new PersonalCalendarItems endpoint, new schemas, and pluralized query params

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

Comment on lines +1108 to +1109
allOf:
- $ref: '#/components/schemas/DottoFoundationV1.TimetableSlot'
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

AcademicService.TimetableItem.slot is documented as being null for intensive lectures, but the schema does not allow null (OpenAPI 3.1 uses JSON Schema; allOf: [$ref] alone won’t permit null). Either update the schema to allow null (e.g., anyOf with {type: "null"}) or adjust the description to match the actual contract (e.g., “omitted when not in timetable”).

Suggested change
allOf:
- $ref: '#/components/schemas/DottoFoundationV1.TimetableSlot'
anyOf:
- $ref: '#/components/schemas/DottoFoundationV1.TimetableSlot'
- type: 'null'

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +45
「{subjectName}(
{item?.slot ? DAY_OF_WEEK_LABEL[item.slot.dayOfWeek] : ""}
{item?.slot ? PERIOD_LABEL[item.slot.period] : ""}
)」を削除します。
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This multiline JSX inside AlertDialogDescription will introduce extra whitespace/newlines around the weekday/period and before the closing parenthesis when rendered (HTML collapses newlines into spaces). Consider rendering this as a single continuous string (or explicitly controlling spaces with {" "}) to avoid UI formatting regressions, and avoid repeating the item?.slot conditional twice by computing the label once.

Copilot uses AI. Check for mistakes.
@kantacky kantacky merged commit 08d0354 into main Mar 27, 2026
7 checks passed
@kantacky kantacky deleted the update-openapi-schema branch March 27, 2026 05:25
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