Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow unspecified arguments, fixes #484 #487

Merged
merged 1 commit into from
Mar 12, 2018

Conversation

clavin
Copy link
Contributor

@clavin clavin commented Mar 11, 2018

Summary

Fixes #484.

This PR adds the ability to use arguments not specified in the MethodArguments types (auxiliary arguments). For example:

web.chat.postEphemeral({
    user: 'not me',
    channel: 'somewhere',
    text: 'wait, what did that say?',

    extra_argument: 'one that doesnt exist, in fact'
});

Note that this preserves static errors for missing arguments, so if channel in the above example was missing, an error will still be thrown (when using types, of course).

Requirements

@codecov
Copy link

codecov bot commented Mar 11, 2018

Codecov Report

Merging #487 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #487   +/-   ##
=======================================
  Coverage   80.08%   80.08%           
=======================================
  Files           6        6           
  Lines         241      241           
  Branches       37       37           
=======================================
  Hits          193      193           
  Misses         30       30           
  Partials       18       18

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e5d144...0c6cc9e. Read the comment docs.

@aoberoi
Copy link
Contributor

aoberoi commented Mar 12, 2018

thanks so much @clavin, i'm happy with this fix. i was thinking about doing roughly the same thing. the tradeoff here is that argument names that have typos (chanel instead of channel) will not trigger an error. that's less than ideal, but i think once all the methods have an interface for their arguments, we can try to remove AuxilaryArguments (but we might want to preserve it for direct calls to .apiCall() so that can always be seen as an "escape hatch" if you know what you're doing).

@aoberoi aoberoi merged commit 474878a into slackapi:master Mar 12, 2018
@clavin clavin deleted the fix-issue-484 branch March 12, 2018 23:41
@clavin clavin mentioned this pull request Mar 13, 2018
9 tasks
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.

2 participants