-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
What happened
Currently the Settings struct in manifest.go defines both EventSubscriptions
and Interactivity
as struct values rather than pointers, which means omitempty will never take effect.
Lines 189 to 195 in e29b7e3
type Settings struct { | |
AllowedIPAddressRanges []string `json:"allowed_ip_address_ranges,omitempty" yaml:"allowed_ip_address_ranges,omitempty"` | |
EventSubscriptions EventSubscriptions `json:"event_subscriptions,omitempty" yaml:"event_subscriptions,omitempty"` | |
Interactivity Interactivity `json:"interactivity,omitempty" yaml:"interactivity,omitempty"` | |
OrgDeployEnabled bool `json:"org_deploy_enabled,omitempty" yaml:"org_deploy_enabled,omitempty"` | |
SocketModeEnabled bool `json:"socket_mode_enabled,omitempty" yaml:"socket_mode_enabled,omitempty"` | |
} |
This results in an empty EventSubscriptions
or Interactivity
object being passed to Slack as an empty JSON object that is impossible to get rid of and requires you to work around it by doing things like setting an EventSubscriptions
object even when you're not using oauth scopes that would require these fields.
Expected behavior
These should be pointers and be omitted when serializing to JSON
Steps to Reproduce
- Create a Slack app without scopes for
EventSubscriptions
- Create a
slack.Manifest{}
object without settingEventSubscriptions
- Call
CreateManifestContext(ctx, manifestStruct, your config token)
- See the error claiming you have an invalid manifest because your
EventSubscriptions
.RequestUrl is invalid - Curse quietly
- Print the object in logging and see the struct definition
- Open this issue
- Open a PR to fix it.
Versions
- Go: 1.24
- slack-go/slack: v0.17.3
Metadata
Metadata
Assignees
Labels
No labels