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

Make all limit parameters in Mastodon methods nullable with null default #366

Closed
bocops opened this issue Nov 30, 2023 · 1 comment · Fixed by #367
Closed

Make all limit parameters in Mastodon methods nullable with null default #366

bocops opened this issue Nov 30, 2023 · 1 comment · Fixed by #367
Assignees

Comments

@bocops
Copy link
Collaborator

bocops commented Nov 30, 2023

As discussed in #293, all endpoints that accept a limit parameter coerce this value to be within the accepted range and do not fail for values outside that range, so no client-side checking of this value is necessary and might even turn out to be problematic if the accepted range ever changes.

As pointed out in #360, having default values for our limit parameters can be equally problematic. Instead, all limit parameters should default to null and only be added to the request if non-null. This ensures that the server's default value will always be used, unless specified by the library user.

@bocops
Copy link
Collaborator Author

bocops commented Nov 30, 2023

Info: I just tested server behaviour by removing the limit from parameter lists built in several of our methods and then running relevant samples we provide. All of those I tested do work as expected even if no value for limit is provided.

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

Successfully merging a pull request may close this issue.

2 participants