Skip to content

Update OpenAPI schema#19

Merged
kantacky merged 5 commits into
mainfrom
update-openapi-schema
Apr 24, 2026
Merged

Update OpenAPI schema#19
kantacky merged 5 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@e680786

kantacky and others added 3 commits April 24, 2026 11:34
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kantacky kantacky marked this pull request as ready for review April 24, 2026 11:41
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 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 messagebody in 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 ↔ API Body.

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: messagebody, 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

  • NotificationRequest includes new optional delivery-related fields in the schema/generated types (imageUrl, analyticsLabel, apns*/android*/webpushLink), but they are currently ignored when converting to domain.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

  • Notification now 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.

Comment thread openapi/openapi.yaml
@kantacky kantacky self-assigned this Apr 24, 2026
github-actions Bot and others added 2 commits April 24, 2026 12:09
androidTtlSeconds と apnsBadge の型が int32 から int に変更されたため、生成コードを再生成した。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kantacky kantacky enabled auto-merge (squash) April 24, 2026 12:19
@kantacky kantacky merged commit 01b9cd9 into main Apr 24, 2026
1 check passed
@kantacky kantacky deleted the update-openapi-schema branch April 24, 2026 12:42
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