Skip to content

fix: make metadata fields optional to handle missing API responses - #130

Open
ishii-masaki-646 wants to merge 1 commit into
nota:mainfrom
ishii-masaki-646:fix/optional-metadata-fields
Open

fix: make metadata fields optional to handle missing API responses#130
ishii-masaki-646 wants to merge 1 commit into
nota:mainfrom
ishii-masaki-646:fix/optional-metadata-fields

Conversation

@ishii-masaki-646

Copy link
Copy Markdown

Summary

  • GyazoImage 型の metadata とその各フィールド(app, title, url, desc)を optional + null 許容に変更
  • metadata にアクセスする箇所でオプショナルチェーン (?.) を追加し、metadata が存在しない画像でのランタイムエラーを防止

Test plan

  • metadata が存在しない画像でリソース一覧取得がエラーにならないことを確認
  • metadata が存在しない画像でメタデータ Markdown 生成がエラーにならないことを確認
  • metadata が存在する画像で従来通り正しく動作することを確認

🤖 Generated with Claude Code

The Gyazo API may return images without metadata or with null metadata
fields. This caused runtime errors when accessing metadata properties.
Updated the GyazoImage type and added optional chaining where metadata
is accessed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ishii-masaki-646 added a commit to ishii-masaki-646/gyazo-mcp-server-forked-from-official that referenced this pull request Mar 11, 2026
Include fixes from nota#129 and nota#130:
- Remove data URI prefix from fetchImageAsBase64 return value
- Make metadata and its fields optional to handle missing API responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant