Skip to content

Update OpenAPI schema#21

Merged
kantacky merged 3 commits into
mainfrom
update-openapi-schema
Apr 28, 2026
Merged

Update OpenAPI schema#21
kantacky merged 3 commits into
mainfrom
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@058bf5f

kantacky and others added 3 commits April 28, 2026 10:06
Notification の targetUserIds/isNotified を targetUsers (NotificationTargetUser) に置き換えた openapi.yaml に合わせて、oapi-codegen で生成した API 型を再生成する。
API スキーマ変更に追従し、ドメインの TargetUserIDs を NotificationTargetUser のスライスへ変換するようにする。IsNotified フィールドは API から削除されたため出力しない。
@kantacky kantacky marked this pull request as ready for review April 28, 2026 10:08
@kantacky kantacky self-assigned this Apr 28, 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

Updates this repository’s OpenAPI 3.1 schema (and corresponding generated Go types + handler conversion) to match the latest dotto-typespec output, primarily adjusting how notification target users are represented in API responses.

Changes:

  • Update Notification schema to replace targetUserIds (and remove isNotified) with targetUsers referencing a new NotificationTargetUser schema.
  • Update handler conversion to populate Notification.targetUsers from the domain model.
  • Regenerate generated/api.gen.go models to reflect the updated OpenAPI schema (adds NotificationTargetUser, updates Notification fields).

Reviewed changes

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

File Description
openapi/openapi.yaml Updates Notification-related schemas; introduces NotificationTargetUser.
internal/handler/converter.go Converts domain TargetUserIDs into API targetUsers.
generated/api.gen.go Regenerated types: Notification.TargetUsers, adds NotificationTargetUser.

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

Comment thread openapi/openapi.yaml
Comment on lines +484 to +488
targetUsers:
type: array
items:
type: string
description: 対象ユーザーIDのリスト
$ref: '#/components/schemas/NotificationTargetUser'
description: 対象ユーザーのリスト
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The response Notification schema no longer includes an isNotified field, but the /v1/notifications list endpoint still accepts the isNotified query parameter for filtering. This makes it impossible for clients to distinguish notified/unnotified items when no filter is applied; consider either reintroducing a per-notification status field (or a replacement such as a timestamp) or removing the filter parameter to keep the contract consistent.

Copilot uses AI. Check for mistakes.
Comment thread openapi/openapi.yaml
Comment on lines +563 to +569
notifiedAt:
type: string
format: date-time
description: |-
通知送信日時

通知が送信された日時。送信前は null
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

NotificationTargetUser.notifiedAt is documented as "送信前は null" but the schema currently defines it as type: string only. In OpenAPI 3.1 (JSON Schema), this forbids null values; either update the schema to allow null (e.g., union with null) or adjust the description to indicate the field is omitted when not sent.

Copilot uses AI. Check for mistakes.
@kantacky kantacky merged commit d8cdac1 into main Apr 28, 2026
6 checks passed
@kantacky kantacky deleted the update-openapi-schema branch April 28, 2026 10:24
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