firebase / firebase/firebase-admin-go

AndroidConfig.Notification.ChannelId field mapping mismatch between API Explorer and Go SDK

Open
#688 1 comment 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
Go
Stars
1.3k
Forks
274
Avg merge
10h 39m
Merged PRs (30d)
2

Description

Problem:
- In the API Explorer for FCM REST API (projects.messages/send), the example request body shows the JSON field for AndroidConfig.Notification.ChannelId as "channelId"
- However, in the Go SDK, this field is mapped as "channel_id" in the struct tags
- Due to this inconsistency, when using the Go SDK, the notification channel ID is not properly transmitted to FCM, making it impossible to change notification sounds through this field

Proposed Solution:
- Update the json tag in AndroidConfig.Notification structure from "channel_id" to "channelId" to match the API specification
- Add tests to verify the fix works while maintaining backward compatibility

The mismatch can be verified at: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send
(See the "Try this API" section where the API Explorer shows the correct field name)

Contributor guide

Open the contributing guide

Research direction

Start by locating the AndroidConfig.Notification structure in the Go SDK and compare its JSON mapping with the FCM REST API Explorer at the linked documentation page. Add focused regression tests for the corrected field mapping and backward-compatibility behavior. Done means the SDK transmits the documented channel ID field and the tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.