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

Fix and make edit_role_position plural #2954

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

mkrasnitski
Copy link
Collaborator

@mkrasnitski mkrasnitski commented Aug 23, 2024

There was a regression introduced to the edit_role_position endpoint in #2806 - this endpoint expects an array of json objects but a single object was being sent to the API, not inside of an array. This means the response would always error due to invalid format.

This PR fixes said bug by pluralizing the endpoint to take a list of roles to edit. The list will be serialized as a JSON array.

@github-actions github-actions bot added model Related to the `model` module. builder Related to the `builder` module. http Related to the `http` module. labels Aug 23, 2024
Copy link
Member

@GnomedDev GnomedDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either change this to use SerializeIter, or change the arguments to take a slice instead of an iterator, as otherwise this is just taking something different to what is needed.

src/model/guild/guild_id.rs Outdated Show resolved Hide resolved
@GnomedDev GnomedDev changed the title Make edit_role_position plural Fix and make edit_role_position plural Aug 23, 2024
@GnomedDev GnomedDev merged commit 0c27128 into serenity-rs:next Aug 23, 2024
21 checks passed
@mkrasnitski mkrasnitski deleted the edit-role-positions branch August 23, 2024 19:45
@GnomedDev GnomedDev added breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users fix A solution to an existing bug. labels Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users builder Related to the `builder` module. fix A solution to an existing bug. http Related to the `http` module. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants