Update OpenAPI schema#21
Conversation
Notification の targetUserIds/isNotified を targetUsers (NotificationTargetUser) に置き換えた openapi.yaml に合わせて、oapi-codegen で生成した API 型を再生成する。
API スキーマ変更に追従し、ドメインの TargetUserIDs を NotificationTargetUser のスライスへ変換するようにする。IsNotified フィールドは API から削除されたため出力しない。
There was a problem hiding this comment.
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
Notificationschema to replacetargetUserIds(and removeisNotified) withtargetUsersreferencing a newNotificationTargetUserschema. - Update handler conversion to populate
Notification.targetUsersfrom the domain model. - Regenerate
generated/api.gen.gomodels to reflect the updated OpenAPI schema (addsNotificationTargetUser, updatesNotificationfields).
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.
| targetUsers: | ||
| type: array | ||
| items: | ||
| type: string | ||
| description: 対象ユーザーIDのリスト | ||
| $ref: '#/components/schemas/NotificationTargetUser' | ||
| description: 対象ユーザーのリスト |
There was a problem hiding this comment.
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.
| notifiedAt: | ||
| type: string | ||
| format: date-time | ||
| description: |- | ||
| 通知送信日時 | ||
|
|
||
| 通知が送信された日時。送信前は null |
There was a problem hiding this comment.
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.
This PR updates the OpenAPI schema from dotto-typespec.
Triggered by: fun-dotto/dotto-typespec@058bf5f