Skip to content

Use of HTTP methods in the API is bad #1

@PeterHindes

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.

Path Line Current Method Action Recommended Method
/{prefix}/{designid}/{version}/removeCollection 586 get Remove Collection DELETE
/{prefix}/{designid}/{version}/remove 622 get Remove Object DELETE
/{prefix}/{designid}/{version}/replace 660 get Replace Object DELETE
/{uri}/remove 2631 get Remove Object DELETE
/{uri}/replace 2655 get Replace Object DELETE

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions