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

slack_api::usergroups::list uses incorrect schema #98

Open
nikclayton-dfinity opened this issue Jul 14, 2020 · 2 comments
Open

slack_api::usergroups::list uses incorrect schema #98

nikclayton-dfinity opened this issue Jul 14, 2020 · 2 comments

Comments

@nikclayton-dfinity
Copy link

Trying to call usergroups::list returns a MalformedResponse error.

In my case this is because the value for the user_count field is an int, not a string.

I assume the schema in https://github.com/slack-rs/slack-api-schemas/blob/master/objects/usergroup.json is incorrect.

In addition, I see in the output (at the same level as the user_count field) a channel_count field which is also an int, and appears to be missing from the schema.

@dten
Copy link
Contributor

dten commented Jul 16, 2020

this is where slack's docs are a bit of a pain with types, their example shows user_count as a string
https://api.slack.com/methods/usergroups.list

even their schema shows a string in their example
https://raw.githubusercontent.com/slackapi/slack-api-specs/master/web-api/slack_web_openapi_v2.json

but it says it returns objs_subteam objects, which say

                "user_count": {
                    "type": "integer"
                },

the schema we have was scraped from their examples before they started work on their own schema

last i checked it was missing loads of information which made generating functions from it not possible. but it does look a lot better now.

I think some syncing is over due

@dten
Copy link
Contributor

dten commented Jul 16, 2020

I also started adding some tests that actually call the apis, but that obviously requires a slack workspace to connect to. or a really good fake, and I haven't seen any easy fakes

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

No branches or pull requests

2 participants