discord-api-docs
discord-api-docs copied to clipboard
Modify Guild Onboarding parameters are all optional, but documented as required
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. https://github.com/discord/discord-api-docs/blob/3b0b05eea18c3c8f4561dc0b9d3bbb84fa5082bc/docs/resources/Guild.md?plain=1#L1333-L1340
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.