Setting the Path or Suffix for a REST Resource
You can set the path or suffix used for a REST resource included in a REST API descriptor.
By default, each REST resource in a REST API descriptor derives its path from the namespace of the REST resource. For example, if the REST resource is named myREST.myRESTResource, the path is “/myREST.myRESTResource”. However, you might not want to expose the namespace of the REST resource in the Swagger document. You can override the default path with a path that you specify. For example, you could use /customers/premium or /myPath.
By default, there is no suffix for the REST resources in a REST API descriptor. However, if you want users who invoke the REST resource to include query parameters, you can specify that information in the suffix. Integration Server appends the suffix to the path. For example, if you want the request to invoke a REST resource to include the $resourceID, specify a suffix of: /{$resourceID}. If you want the request URL to include the $resourceID and the $path, specify a suffix of /{$resourceID}/{$path}.
If you change the path and/or suffix, make sure that Integration Server can resolve the resulting resource path. The path must be invokable by Integration Server.
Note: | The values that you specify for the path and/or suffix apply only to the REST resource as it used in this REST API descriptor. It does not affect the same REST resource used in another REST API descriptor or the REST resource itself. |
To set the path or suffix for a REST resource
1. In the Package Navigator view, lock and open the REST API descriptor for which you want to specify a path and/or suffix for a REST resource.
2. Click the REST Resources tab.
3. Select the REST resource for which you want to specify a path and/or suffix.
4. To specify a path for the REST resource, in the Properties view, next to Path, type the path that you want to use for the REST resource.
If you do not include “/” as the first character in the Path property, Integration Server adds it in the Swagger document.
5. To specify a suffix for the REST resource, next to Suffix, type the suffix than you want to use for the REST resource.
6. Click File > Save.