Clean up API endpoints #1688
Replies: 3 comments
-
|
@bbockelm Thoughts? |
Beta Was this translation helpful? Give feedback.
-
|
@CannonLock - can you expand a bit? What do you mean by "don't follow best practices" and what would you like to see instead? |
Beta Was this translation helpful? Give feedback.
-
|
@bbockelm Yes, let me be more verbose. OPTIONS - /registry_ui/namespaces
This request is a metadata request. OPTIONS are sent for things like a preflight check for CORS headers, or looking for the request types a endpoint will except. This should be a GET request to These break the no verb endpoint spec I see this broken for login commonly but it hurts for things like this were it just adds extra endpoints that aren't need. PATCH - /registry_ui/namespaces/<namespace>/approve I would prefer: PATCH - /registry_ui/namespaces/<namespace> This way I have one endpoint to adjust every aspect of these entities. This makes it easier to code, and more extensible for the future as I can adjust the json PATCH for the change I want rather then creating a new endpoint for each action. Note I crossed out the HEAD request, the docs have it returning a body which is strictly forbidden but on testing it just returns the headers. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The existing API's don't follow best practices for RESTFUL apis and we should move to that standard before things get bigger. I enumerated below the offenders.
Lets clean up:
Beta Was this translation helpful? Give feedback.
All reactions