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

Add MAX_MULTI_UPDATES config #141

Open
Deconstrained opened this issue Oct 25, 2024 · 0 comments
Open

Add MAX_MULTI_UPDATES config #141

Deconstrained opened this issue Oct 25, 2024 · 0 comments

Comments

@Deconstrained
Copy link
Collaborator

Deconstrained commented Oct 25, 2024

Description: If PUT, and json is a list, limit the list size to 250.

Justification: This will prevent the client from making unnecessary HTTP requests that are expected to elicit a status 418 response because the limit is exceeded, or even providing the basis for batching requests to handle a very large list.

Risks: other endpoints could potentially implement multi-update without such a limit, or with a different limit. We may need to use a crutch similar to ENTITY_WRAPPER_CONFIG to get around this in the near future if/when this happens, to avoid arbitrarily depriving users of a higher multi-update limit in an endpoint that allows it.a We then have another manually-maintained list where adding support is a one-liner.

Precedent: we already do this for the max offset in pagination to prevent wasted API calls, so it makes sense to do it here, despite the risk of us adding another antipattern config. Where the assumptions made in the abstractions of this client do not hold universally true for all constituent APIs of REST API v2, is where we have to manually maintain some list that distills each divergence between client expectations and API design (or automate it if possible using the documentation source).

Sources:

The limit should eventually be documented here: https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTU0-endpoints#put-resources-update-multiple

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

No branches or pull requests

1 participant