Service Metadata and Response Schemas for Custom Actions

If a given REST API supports custom actions, they are described in the OpenAPI service metadata generated by the ADF REST service. For example, a reject BO item level custom action would appear in the paths collection:

// Note: some JSON content has been omitted for brevity/clarity

"/ExpenseReports/{ExpenseReports_Id}/action/reject": {
    "parameters": [
      {
        "$ref": "#/components/parameters/ExpenseReports_Id"
      }
    ],
    "post": {
      "summary": "reject",
      "description": "reject",
      "operationId": "do_reject_ExpenseReports",
      "responses": {
        "default": {
          "description": "The following table describes the default response for this task.",
          "content": {
            "application/vnd.oracle.adf.actionresult+json": {
              "schema": {
                "type": "object",
                "properties": {
                  "result": {
                    "type": "string"
                  }
                },
                "required": [
                  "result"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      },
      "requestBody": {
        "description": "The following table describes the body parameters in the request for this task.",
        "content": {
          "application/vnd.oracle.adf.action+json": {
            "schema": {
              "type": "object",
              "properties": {
                "rejectionReasonCode": {
                  "type": "string",
                  "nullable": true
                },
                "notes": {
                  "type": "string",
                  "nullable": true
                }
              },
              "additionalProperties": false
            }
          }
        }
      }
    }
  }

Note the following:

  • For a BO item level custom action, the path entry contains a path parameter for the row/item ID, for example:

    /ExpenseReports/{ExpenseReports_Id}/action/reject"

    In the case of a BO level custom action, the path (such as /ExpenseReports/action/sendToAuditor) doesn't include a path parameter for the row/item.

  • The end of the path entry (reject) matches the name of the custom method defined in the service. See Publishing Custom Service Methods to UI Clients.
  • The presence of a POST operation for the action path entry is required.
  • In the requestBody schema, there are properties that match the parameters defined in the custom method signature from the service. In this document, these properties are referred to as custom action payload fields.