-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
Add JSON encoding to all applicable Web API arguments #448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this very much! See my suggestions/comments below. Definitely needs tests.
@dblock Here's a different take, trying to base it entirely on data in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot better! I think you should modify slack-api-ref to make it less fragile, aka parse the description for json in its scraper, and generate a field.
@dblock still needs tests and changelog, but here's what this looks like now with the slack-ruby/slack-api-ref#64 |
Looks good! |
@@ -1,6 +1,7 @@ | |||
### 2.1.1 (Next) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's bump the version to 2.2 and make a release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'm going to put up another PR to replace some of the patched argument validations with the new arg_groups
data from the ref, so I'll do it in that.
There was at least one
chat.*
method that was missing the auto-encoding ofblocks
andattachments
into JSON (chat.scheduleMessage
). Instead of continuing to apply these to each method individually as a patch, I thought it would be nice to solve this once and for all.New groups of methods or new options that require encoding will require changes to accommodate those, but no patching.This is now being pulled from data in slack-api-ref and will update automatically with the docs.I'm open to suggestions on the exact approach, and I'm opening this as a draft without tests, changelog, etc. to gather comments first.