Managing REST Resource Definitions for Open API REST Service

Only one Service Operation for each REST method type is supported for an Open API REST Service. Service Operation Root Resources can be created to create different Service Operations based off the Root Resource.

This example illustrates the REST Resource Definition section for an Open API REST Service.

REST Resource Definition section for Open API REST Service

Building the REST Resource Definition involves the following steps:

  1. If URI variables are to be included in the template, it is necessary to create a Document Template message that contains the variables for the URI.

    See Adding Documents and Creating Document Message Definitions.

  2. Add Root Resources.

  3. Select the Document Template.

  4. Build the URI index by manually entering the URI or using the Build link.

  5. Use the Details link to define the Request, Response, and Fault messages for the URI.

  6. Use the Validate link to validate the URI.

  7. Add Service Operation Handler information.

  8. When you save the Service Operation a Any-to-Local routing will be created.

Use the Add/Remove Root link to define Root Resources for the Service Operation.

This example illustrates the Add/Remove Root Resources page.

Add/Remove Root Resource page

The Root Resource names must meet Oracle naming standards.

The description is mandatory as it is used as part of the Open API document generation.

A Root Resource can be deleted using the Delete Row icon if its not already defined on the URI Template.

You can define one or more URI template strings to define one or more resources for the definition.

URI template strings can be entered manually or using the Build link.

Manually Entering the URI Template String

To manually enter the URI template string:

  1. Select the root resource.

  2. Enter the string starting with the root resource, using separators between variables and enclosing the variables in brackets {}.

This example illustrates Template URI strings.

URI Template with values

Using the Build link

Note: You must enter the Document Template field before you can use the Build option.

To use the Build link to enter the URI string:

  1. Select the Document Template.

  2. Select the Root Resource.

  3. The root resource is added to the template field.

  4. Click the Build link.

  5. Add a separator when needed.

  6. Select variables from the template and click Add.

    The variable is displayed in brackets.

  7. Click Append to URI.

    The URI Template field shows the current value.

  8. Repeat steps 5 to 7 for each variable to add.

  9. Click OK when the URI template is complete.

This example illustrates the URI Template Builder page.

URI Template Builder page

For additional information on the URI Template Builder, see Using the URI Template Builder

Use the URI Template Details page to define the messages for the service operation.

To add or modify the Details for a URI index, click the Details link for that row.

This example illustrates the URI Template Details page.

URI Template Details page

Field or Control

Description

URI Template

The URI Template is displayed.

Description

Enter a description for the URI resource.

Type

Depending on the REST method, the required message types will be available on this page. Types are Request, Response and Fault.

Message.Version

Enter the message name followed by a dot and version, or click the Lookup button to search for a message.

Content-Type

Select the content type. The valid values are:

  • application/json

  • application/xml

Status Code

Select the Status Code from the drop down list.