node-slack-sdk
node-slack-sdk copied to clipboard
Why is `WebAPICallOptions` not type-safe?
Description
I recently encountered a bug that was due to using a non-existent property in ChatPostMessageArguments
, which I assumed would not have been possible as it is a TypeScript interface. But such interface extends WebAPICallOptions
, which allows any arbitrary key value pair, effectively removing its static type checking.
What type of issue is this? (place an x
in one of the [ ]
)
- [ ] bug
- [ ] enhancement (feature request)
- [x] question
- [ ] documentation related
- [ ] testing related
- [ ] discussion
Requirements (place an x
in each of the [ ]
)
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Hi @rr-codes, this is a good question! My understanding is that the arbitrary keys were added for pagination support. Ideally, we would change it, but we must find a way to safely remove it from pagination. If we did, it would be a breaking change and need to be released in our next major version bump.
@kaz Since you're focused heavily on TS support right now, do you want to discuss this change more and possibly turn this into a task for the next major?
As an additional note,
If we did, it would be a breaking change and need to be released in our next major version bump.
if we decided to do this, we may want to apply the similar to WebAPICallResult
.
Closing this as a duplicate of #1323