Define your resource operations
Operations are the HTTP methods used to manipulate the resources of your Web service.
For each resource path, you define an operation (HTTP method) that can be used to access the resource. An HTTP operation such as GET, POST, PUT, or DELETE, must be represented in your REST function in order to provide its service.
The same resource path can support several operations, for example, GET /users
to get a list of users and POST /users
to add a new user, etc. However, only one
operation is allowed per function and therefore you must provide separate functions for these
operations.
In the OpenAPI specification the combination of resource path and an HTTP method defines a unique function. Two GET or two POST functions for the same path are not allowed; even if they have different parameters. Input parameters or return values do not effect the uniqueness of the function.
Define functions with operation attributes
In GWS REST the attributes that perform operations are identifiable by the HTTP verb in the name, for example, WSGet, WSDelete, WSPost, and WSPut, etc. Your REST function must have one of these attributes in order to define its service. You can use these attributes in the attributes clause of your function.
Publishing operations
When you generate the service description, the operations you declared are published in a node. For example, there is a "get" node if it describes a GET operation. You find the operation node under the path for that resource in your OpenAPI specification file.