Skip to content

DI‐Portal‐OPVIEW‐00X Examples panel

Aleksandr Agishev edited this page May 5, 2025 · 1 revision

Design Item ID: DI-Portal-COMP-00X
Design Item Name: Examples panel
Related Design Items:
Related API: -
Revision History:

Date Description

Description

The examples panel in the APIHUB Portal provides users with the ability to view Request and Response examples for the selected operation. This allows users to better understand the structure of requests and responses, and it is useful for testing and integrating APIs.

Start Point

  1. User navigates to APIHUB Portal → specific workspace→ specific group→ specific package version → API Operations/ Deprecated Operation tab

Execution

  1. The user clicks on operation.
  2. The system opens the Doc view.
  3. User clicks Examples button.
  4. The system opens a right sidebar displaying two tabs - Request Example and Response Example. By default, request example tab is selected; if tab is disabled then response example tab is selected.
    • The request example tab is enabled of operation has a request body. Otherwise, tab is disabled and the system shows tooltip on hover: "Request example is not applicable to the operation".
    • The response example tab displays all response codes specified in the current operation. The user is able to select status code and see its relevant example.
      • if response code does not have schema, then the system shows the message "Example not available".
    • The request example tab shows example for schema of request body; response example tab shows example for schema of response code.
      • examples is shown in json format
    • Tabs has dropdown field, which display name(s) of example(s)
    • Content of example on both tab are following:
      • If media type has "example" object, then this example will be displayed. Such example has "default" name.
      • If media type has "examples" object with at least one example object, then this example will be displayed. Such example has name equals to example key.
      • If "examples" object has multiple example object, then the system allows selecting one of the example from dropdown list. Such example has name equals to example key.
      • If no explicit examples are defined in the OpenAPI specification for a request body / response code, then the system autogenerates example; such example has "autogenerated" name.
    • By default, the system shows example only for schema of "application/json" media type. If request/response does not have such media type, then example for the schema of the first media type will be displayed.
    • Autogenerated example is shown as following:
      • the system takes schema of request/response code
      • for the fields from the schema, the system generates value for the fields:
        • if the field has defined example on OAS, then the system takes this value; if example is not specified, then
        • the system takes default value of field; if default value is not specified, then
        • the system takes the first enum value from enum attribute; of enum is not specified, then
        • the system takes type of the field as value.
  5. User clicks Expand button.
  6. The system opens right sidebar with example as popup window.
  7. User clicks Close button.
  8. The system closes popup and example is again displayed in the right sidebar.
  9. User hovers over Generate button.
  10. The system shows tooltip: "Coming soon". Currently button is always disabled.

Screen View

Processes description
Technical articles
Design Items

General Functionality

Package Version

Dashboard version editing/creation

Package/Dashboard Settings

Package Settings

Operation Content View

Comparison

Portal Global Settings

Portal User Settings

Custom OpenAPI Extensions

Global Search

Agent

VS Code Extension

E2E Regression

UI Regression

Clone this wiki locally