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

v3 REST API: Inconsistencies in DELETE endpoints with request bodies #16

Open
gr2m opened this issue Jan 10, 2018 · 2 comments
Open

v3 REST API: Inconsistencies in DELETE endpoints with request bodies #16

gr2m opened this issue Jan 10, 2018 · 2 comments

Comments

@gr2m
Copy link
Contributor

gr2m commented Jan 10, 2018

In total there are 7 DELETE routes that accept a request body. 4 of these expect the body to be the JSON string of the array input. The remaining 3 use namespacing for the input variables.

One of these 3 has only a single variable: Remove assignees from an issue. The other two have multiple input parameters, so it wouldn’t work without namespacing:

The 4 routes that expect the JSON string to be the input value only have a single input parameter:

I would suggest use namespace input parameters for all endpoints.

This could be done without breaking the API, the route handler could detect if it receives an object or an array (or single string in some cases) and handle it accordingly.

This inconsistency makes things a bit harder for the developers of Octokit libraries for the REST API, as they have to hardcode these exceptions. An alternative would be to call the parameter input for some while e.g. labels for others, but that would be confusing and again, inconsistent.

@kytrinyx
Copy link

Thanks! Yeah, I'm all about consistency. Being able to do it without breaking the API would be crucial. Let me file this internally to the team for discussion.

@kytrinyx
Copy link

I found a POST endpoint that takes a bare array as input, as well:

I'm going to go through all the endpoints (not just DELETE) to map out any endpoints that don't take an object as the body.

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

2 participants