-
Notifications
You must be signed in to change notification settings - Fork 31
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
Wrapped entity key error for Tags linked entity endpoint #130
Comments
Hello, and pardon the late reply! For which values of The documentation for GET /tags/{id}/{entity_type} indicates that the entity wrapper name matches the last path node. If the API is not always responding with the documented schema, it is within reason to consider this a bug in the API itself. In that case, I'd be glad to create an issue report for it. |
I think I identified the issue ( In short, the idea behind an adequate fix is to make the guardrail that says "this endpoint wasn't meant for pagination" able to properly evaluate the path as referring to a collection and not an individual resource. Edit: I have decided on a solution. |
Thank you so much! yeah, when I started diving, it definitely sounded like this was a "strange" endpoint from the data type pov. If it helps, it was with users :) |
For the record: the solution decided upon was to expand the single canonical path into multiple paths as though they were separately documented for each explicit If new entity types are added to the tags API endpoint in question, support for them will need to be added by updating |
The
tags/{id}/{entity_type}
endpoint is officially supported by pdpyras (see https://github.com/PagerDuty/pdpyras/blob/main/pdpyras.py#L198), but it is a paginated wrapped entity endpoint that does not respect the rules, as it uses the entity_type as its wrapper key. We get errors if we try to use iter_all/list_all on it.Is there a solution, or should I just use the "raw" queries and do my loop pagination myself?
I would be happy to make a PR if an idea of what the solution should be is offered; right now, I am not sure of the best way, if any.
The text was updated successfully, but these errors were encountered: