Skip to content

Conversation

@pathob
Copy link
Contributor

@pathob pathob commented Jul 22, 2024

In entity collections such as application links, where each entity itself is a complex construct already, we use the following naming scheme together with the following HTTP methods.

Single entity:

  • GET: getEntity
  • POST: createEntity
  • PUT: updateEntity
  • DELETE: deleteEntity

Multiple entities:

  • GET: getEntities
  • PUT: setEntities
  • DELETE: deleteEntities

Whereas PUT setEntities will be replaced by PATCH in a future release to better explain that these methods may create OR update entities, but only the ones that are sent in the request.

For collections that kind of form a single entity themselves, the methods work a bit different. E.g. the trusted proxies in Crowd are one single entity in the form of a list of entries (the trusted proxies). Here, and in similar cases, we would use:

  • GET: getEntries
  • PUT: setEntries
  • POST: addEntry
  • DELETE: removeEntry

However, here we would stick to PUT for setEntries since it makes more sense.

@pathob pathob force-pushed the resource-naming-schema branch from b03e32d to d96af90 Compare July 22, 2024 21:16
In entity collections such as application links, where each entity
itself is a complex construct already, we use the following naming
scheme together with the following HTTP methods.

Single entity:

- `GET`:    getEntity
- `POST`:   createEntity
- `PUT`:    updateEntity
- `DELETE`: deleteEntity

Multiple entities:

- `GET`:    getEntities
- `PUT`:    setEntities
- `DELETE`: deleteEntities

Whereas `PUT` setEntities will be replaced by `PATCH` in a future
release to better explain that these methods may create OR update
entities, but only the ones that are send in the request.

For collections that kind of form a single entity themselves, the
methods work a bit different. E.g. the trusted proxies in Crowd are one
single entity in the form of a list of entries (the trusted proxies).
Here, and in similar cases, we would use:

- `GET`:    getEntries
- `PUT`:    setEntries
- `POST`:   addEntry
- `DELETE`: removeEntry

However, here we would stick to `PUT` for setEntries since it makes more
sense.
@pathob pathob force-pushed the resource-naming-schema branch from d96af90 to 64d1e49 Compare July 22, 2024 21:23
@sonarqubecloud
Copy link

@pathob pathob merged commit a24b1f3 into main Jul 22, 2024
@pathob pathob deleted the resource-naming-schema branch July 22, 2024 21:33
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

Successfully merging this pull request may close these issues.

2 participants