Skip to content

Use of HTTP methods in the API is bad #1

Description

@PeterHindes

Incorrect HTTP Methods in openapi-main.yaml

The following endpoints in docs/openapi-main.yaml use the GET method for destructive or state-changing actions, which is incorrect according to REST principles and OpenAPI best practices. These should be changed to DELETE (preferred) or POST.

PathLineCurrent MethodActionRecommended Method
/{prefix}/{designid}/{version}/removeCollection586getRemove CollectionDELETE
/{prefix}/{designid}/{version}/remove622getRemove ObjectDELETE
/{prefix}/{designid}/{version}/replace660getReplace ObjectDELETE
/{uri}/remove2631getRemove ObjectDELETE
/{uri}/replace2655getReplace ObjectDELETE

Other Observations

While not strictly "incorrect" in a functional sense, the following endpoints use POST for deletion/removal. Following REST best practices, these should ideally use DELETE:

  • /{uri}/removeOwner/{username} (Line 406)
  • /{prefix}/{designid}/{version}/removeMembership (Line 800)
  • /admin/deleteRemote (Line 343)
  • /admin/deleteRegistry (Line 851)
  • /admin/deletePlugin (Line 1976)
  • /admin/deleteUser (Line 2366)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions