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

Modify Guild Onboarding parameters are all optional, but documented as required #6887

Open
GnomedDev opened this issue May 23, 2024 · 0 comments

Comments

@GnomedDev
Copy link

Description

Title sums it up. The documentation linked below currently says that all arguments to this endpoint are required when the API seems to accept partial requests similar to other Modify endpoints.

###### JSON Params
| Field | Type | Description |
|---------------------|-----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| prompts | array of [onboarding prompt](#DOCS_RESOURCES_GUILD/guild-onboarding-object-onboarding-prompt-structure) objects | Prompts shown during onboarding and in customize community |
| default_channel_ids | array of snowflakes | Channel IDs that members get opted into automatically |
| enabled | boolean | Whether onboarding is enabled in the guild |
| mode | [onboarding mode](#DOCS_RESOURCES_GUILD/guild-onboarding-object-onboarding-mode) | Current mode of onboarding |

This also brings into question why it is using PUT, instead of PATCH, but I may be missing something there.

Steps to Reproduce

For example, onboarding can be enabled by using the following cURL command, even though the documentation would lead you to believe that you had to fetch the onboarding object, mutate it, then call the modify endpoint with the whole object.

curl 'https://discord.com/api/v9/guilds/698223755582898207/onboarding' \
  -X 'PUT' \
  -H 'authorization: token' \
  -H 'content-type: application/json' \
  --data-raw '{"enabled":true}'

Expected Behavior

The API rejects the call with an error requiring all fields to be present, or the documentation is updated.

Current Behavior

The API accepts a partial object, when the documentation says it doesn't.

Screenshots/Videos

No response

Client and System Information

Tested using cURL, by observing the client behaviour, and implementing this endpoint for the serenity-rs library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant