-
Notifications
You must be signed in to change notification settings - Fork 4
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 |
|---|---|
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.
- User navigates to APIHUB Portal → specific workspace→ specific group→ specific package version → API Operations/ Deprecated Operation tab
- The user clicks on operation.
- The system opens the Doc view.
- User clicks Examples button.
- 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.
- User clicks Expand button.
- The system opens right sidebar with example as popup window.
- User clicks Close button.
- The system closes popup and example is again displayed in the right sidebar.
- User hovers over Generate button.
- The system shows tooltip: "Coming soon". Currently button is always disabled.
Processes description
Technical articles
Design Items
- AsyncAPI
- Navigation to APIHUB (log in / log out)
- Create Workspace
- Create Group
- Create Package
- Favorite packages, dashboards, groups, workspaces
- Shared Packages
- Activity History in Main Page
- Personal private workspace
- Version summary
- Revision History
- Package Activity History
- Manage Manual Operations Group
- Export Operations Group (reduced source specifications)
- Export Operations Group (combined specification)
- Export List of Operations in Excel
- Search and Filter Operations
- List of Operations
- List of Operations Groups
- Manage REST Path Prefix Group
- Activity History
- List of Deprecated Operations
- Export List of Changes in Excel
- Human‐readable description for deprecated items for OpenAPI 3.0
- List of Documents
- OpenAPI Document Overview
- Copy Package Version
- Export Package Version
- Export Document from Package Version
- Export List of Deprecated Operations in Excel
- API Quality Validation Result
- Export of discrepancy analysis results for arbitrary package versions in Excel
- AI Recommendations Tab
- General Settings
- Package versions list
- Access Tokens Management
- Delete Package
- Default Release Version
- Define Release Version Pattern