-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add warning about boolean metadata fields #5807
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
Conversation
Had a talk with a staff about it and they had a talk with the team. Apparently it's documented enough the way it is and the examples were updated accordingly to reflect this. Don't think a warning is needed. Maybe use instead a footnote?
|
If it's supposed to be a boolean field, |
Not sure why one would assume so if it's explicitly documented already. |
I really think you should reconsider closing this issue. Adding a warning is the very least you should do, but the better option would be to document it properly. It's not explicitly documented; that's the whole problem. |
The assumption that something called a boolean would accept boolean values instead of 0 and 1 is one that anyone would make. A callout warning is the minimum that should be done to avoid this bizarre limitation and design quirk in the API. |
To clarify: the user request at https://discord.com/developers/docs/resources/user#update-user-application-role-connection links to https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object to describe what the metadata object is, and that table clearly indicates that the expected value for boolean types is an integer. |
I think this table is falling victim to shove it all in the description column and I don't think adding a warning to confusing docs is solving the real issue here. Examples of how the table could be improved:
I think something like this would be better for clarifying. I don't think we need to include the type the guild uses internally, from the perspective of the application metadata we dont really care how the guild data is collected from server admins at this stage in the api's flow. In addition to these changes I also think this feature needs a dedicated write up in the docs, and that is the place that the guild settings perspective and how it relates to the metadata should be explained. |
I opened a new issue #5827 to track this—I agree with others that this info shouldn't live here so I don't think we should reopen this PR, but I'll look at reworking connection metadata docs in general to try to clear this up and hopefully make it more explicit. @Mehgugs's idea seems like a step in the right direction. |
When setting metadata on a user, you would assume that you need to set boolean fields to true or false, but you actually need to use 1 or 0. This has caused problems (especially because no error is returned) so I added a warning box to make it clear.