Engineering-Research-and-Development / dsp-true-connector

0 stars 0 forks source link

[Discussion] Define Rest API design best practise and naming convention #65

Closed davidjovanovic closed 1 month ago

davidjovanovic commented 1 month ago

Some suggestions:

In the event that actions that are not directly related to a resource are to be performed, one of the following examples can be envisaged as a solution:

  1. it is possible to use a noun that identifies the resource obtained at the end of the action (e.g /negotiations/{pId}/agreement)

  2. it's possible to use sub-collection resources (e.g. /users/{userId}/profiles)

  3. it's possible to pass the action as a parameter for a POST method

     POST /services/{id}
     {
         "action": "execute",
          ...
     }
  1. instead of invoking /services/{id}/execute, it's possible to create a resource for all the actions that currently can be executed and then invoke something like /services/{serviceId}/actions/{actionId}