Update OpenAPI schema#19
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates this service’s OpenAPI contract (and regenerated Go types) to match the latest dotto-typespec, primarily renaming the notification payload field and expanding the notification schema.
Changes:
- Rename notification field
message→bodyin OpenAPI and generated Go models. - Add optional notification delivery/platform metadata fields (imageUrl, analyticsLabel, apns*, android*, webpushLink) to the OpenAPI schemas and generated models.
- Update handler converters to map domain
Message↔ APIBody.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openapi/openapi.yaml | Updates notification schemas: message→body, adds optional delivery-related fields and descriptions. |
| internal/handler/converter.go | Adjusts API/domain conversion to use Body instead of Message. |
| generated/api.gen.go | Regenerates models to reflect the updated OpenAPI schema (new fields, Body replaces Message). |
Comments suppressed due to low confidence (2)
internal/handler/converter.go:114
NotificationRequestincludes new optional delivery-related fields in the schema/generated types (imageUrl, analyticsLabel, apns*/android*/webpushLink), but they are currently ignored when converting todomain.Notification. This means clients can send these fields with no effect. Either map them into the domain model (and ensure downstream DB/dispatch honors them) or remove/flag them in the API contract to avoid misleading consumers.
func toDomainNotification(id string, req api.NotificationRequest) domain.Notification {
return domain.Notification{
ID: id,
Title: req.Title,
Message: req.Body,
URL: req.Url,
NotifyAfter: req.NotifyAfter,
NotifyBefore: req.NotifyBefore,
TargetUserIDs: req.TargetUserIds,
}
internal/handler/converter.go:94
Notificationnow has many optional fields in the generated OpenAPI model (e.g. imageUrl, analyticsLabel, apns*/android*/webpushLink), but this converter always returns only the legacy subset (id/title/body/url/notify*/isNotified/targetUserIds). If these fields are meant to be supported, they need to be added to the domain model and mapped here (and persisted/used during dispatch); otherwise the API response will silently omit fields that the schema documents.
func toAPINotification(n domain.Notification) api.Notification {
return api.Notification{
Id: n.ID,
Title: n.Title,
Body: n.Message,
Url: n.URL,
NotifyAfter: n.NotifyAfter,
NotifyBefore: n.NotifyBefore,
IsNotified: n.IsNotified,
TargetUserIds: n.TargetUserIDs,
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
androidTtlSeconds と apnsBadge の型が int32 から int に変更されたため、生成コードを再生成した。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
masaya-osuga
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the OpenAPI schema from dotto-typespec.
Triggered by: fun-dotto/dotto-typespec@e680786