User Specifications List
This screen allows the logged in user, to manage their OAPI/SWAGGER specifications.
Header Filters
Allow the user to control what specs are displayed in the main section
Sort by | Allows user to sort the list by Entity name or last modified date using a dropdown list in both ascending and descending orders |
Type | Type of API: Provider or Consumer |
State | The status: Generated or Ungenerated |
Filter by | Entity or title |
Search | Button to filter the results based on the search criteria entered |
New Actions
New Provider | Creates a new Provider specification |
New Consumer | Creates a new consumer specification |
Import Provider | Imports a new Provider specification from a local OAPI/SWAGGER file |
Import Consumer | Imports a new Consumer specification from a local OAPI/SWAGGER file |
Import Provider from Portal | Imports a new Provider specification from an environment in MDRest4i-SDK-Documenter |
Import Consumer from Portal | Imports a new consumer specification from an environment in MDRest4i-SDK-Documenter |
Import Consumer from Postman collection | Imports a new consumer specification from a postman collection export |
New Provider
Use this option to create a new Provider spec.
Title | The Provider title |
Refuuid | Auto-generated from the field "Title" but editable. This refuuid is used as a key for the spec in the MDRDOAPI file, as well as the refuuid for the documenter (MDRDPAGE file) |
Description | Description |
Path | The Path is mandatory. Unlike the consumer, only the path part is required (not the host and port information). Path parameters can be specified as part of the path. For example: /apis/myapi/{nameid} nameid will automatically be added as an inpath parameter in the specification |
Method | The http method, can be selected from the dropdown list (get, post, put, patch, delete, options) |
Gen Template | This determines what generation pattern will be used. Possible values are: RPGLE_EACH - One program per path/method combination in RPGLE. COBOL_DFT - One program per path/method combination in COBOL ILE |
Program Name | The compiled object name of the provider program |
Object Path | Library where the generated provider program will be compiled. Uses IFS format with a helper button. For example: /QSYS.LIB/MDRSTT14.LIB Picks up the default object path stored in the user profile, and can be edited. |
Source File | Location where the provider source will be generated. Uses IFS format with a helper button. MDRest4i supports either an IFS path /mdrtst14/src/skdemo.rpgle or source file /QSYS.LIB/APISRCLIB.LIB/QRPGLESRC.FILE/SKDEMO.MBR . Picks up the default source file name stored in the user profile, can be edited |
The General tab screen now appears.
Hot Tip
If you include query or path parameters in the path variable, while adding a new Provider spec, the SDK will automatically add these parameters into the specification.
For example this path:
Creates a path parameter
and a query parameter
To the OAPI spec:
New Consumer
Use this option to create a new Consumer spec
Title | The Consumer Title |
Refuuid | uto-generated from the field "Title" but editable. This refuuid is used as a key for the spec in the MDRDOAPI file, as well as the refuuid for the documenter |
Description | Description |
Host and Path (URI) | The consumer API URL. In-path parameters can also be used in the URI. For example: https://myhost.com/apis/myapi/{nameid} nameid will automatically be added as an inpath parameter in the specification |
Method | The http method, can be selected from the dropdown list (get, post, put, patch, delete, head) |
Gen Template | This determines what generation pattern will be used. Possible values are: RPGLE_EACH - One program per path/method combination in RPGLE. COBOL_DFT - One program per path/method combination in COBOL ILE |
Program Name | The compiled object name of the consumer program |
Object Path | Library where the generated provider program will be compiled. Uses IFS format with a helper button. For example: /QSYS.LIB/MDRSTT14.LIB Picks up the default object path stored in the user profile, and can be edited. |
Source File | Location where the consumer source will be generated. Uses IFS format with a helper button. MDRest4i supports either an IFS path /mdrtst14/src/skdemo.rpgle or source file /QSYS.LIB/APISRCLIB.LIB/QRPGLESRC.FILE/SKDEMO.MBR . Picks up the default source file name stored in the user profile, can be edited |
Click the "Done" button (which is enabled only after validating all the input fields).
The General tab screen now appears.
Import Provider
Warning
The SDK supports OPAI 3.0.0 upwards
Use this option to import a new Provider from the provided Swagger specification file.
The SDK adds its own extensions to the OAPI/SWAGGER content on import.
Selecting this option opens the file browser from where you select the file to upload. If the import happens successfully, the following screen appears:
The Helper buttons are also available to help you create the source and object paths.
The input fields in the form are picked up from the default values entered in the user profile.
Click the "Done" button (which is enabled only after validating all the input fields). The General tab screen now appears.
Import Consumer
Warning
The SDK supports OAPI 3.0.0 upwards
Use this option to import a new consumer from the provided Swagger specification file.
The SDK adds its own extensions to the OAPI/SWAGGER content on import.
Selecting this option opens the file browser from where you select the file to upload. If the import happens successfully, the following screen appears:
The input fields in the form- Object Library, Source File and language are picked up from the default values entered in the user profile.
The other values would be picked up from the file imported.
Click the "Done" button (which is enabled only after validating all the input fields). The General tab screen now appears.
Import Provider From Portal
Use this option to import a new Provider from the documenter portal.
Selecting this option opens the following popup to select the environment and the API file to upload.
If the import happens successfully, the following screen pops up:
The input fields in the form- Object Library, Source File and library are picked up from the default values entered in the user profile.
The other values would be picked up from the file imported.
Click the "Done" button (which is enabled only after validating all the input fields). The General tab screen now appears.
Import Consumer From Portal
Use this option to import a new Consumer from the portal.
Selecting this option opens the following popup to select the environment and the API file to upload.
If the import happens successfully, the following screen pops up:
The input fields in the form- Object Library, Source File and library are picked up from the default values entered in the user profile.
The other values would be picked up from the file imported.
Click the "Done" button (which is enabled only after validating all the input fields). The General tab screen now appears.
Import Consumer From Postman Collection
How to export from a postman collection
Use this option to import a new consumer from a postman collection export file.
Consider this example in postman where we have created a collection named SDK-V12
Click on the ellipses to bring up the menu and select the option - "Export".
A postman collection may or may not contain multiple folders and sub-folders containing the different requests.
On selecting this option, the postman export file gets saved on your local file system.
Import from the exported postman collection file
Select the option "Import Consumer From Postman Collection" brings up the file explorer where you can select the file you wish to import. After the file is selected, a popup shows up.
A complete dropdown list of all the APIs is shown and the user can select any one to import.
All the folders and the sub-folders (if any) and the APIs would be listed in hierarchical order.
Let us, for example, select the option 3 from the list.
Click the Next button.
Edit the title and Refuuid and remove the invalid characters, if any.
Click "Done". The import is done and the General tab screen now appears!
Main Content List
Left Main Content
Shows the Entity name, Generated status, last generated date/time
Center Main Content
Shows the title,version, the OAS type, consumer or Provider type
Right Main Content
Delete a Spec
Use the button to delete a spec.
Helper buttons
MDRest4i supports iAsp, IFS and Source file options for compilation.
To allow for this a member APIPGM in source file QRPGLESRC in library APISRCLIB, must be entered using this IFS syntax:
/QSYS.LIB/APISRCLIB.LIB/QRPGLESRC.FILE/APIPGM.MBR
The same source file in the folder APISRC would use this syntax:
/APISRC/APIPGM.RPGLE
Using this format, an object path would look like this:
/QSYS.LIB/YOURLIB.LIB/APIPGM.PGM
For those users not familiar with this syntax for lib/file/member or objects, a popup has been created.
This popup allows the traditional manner of editing these details.
Unless you are using a specific iASP, this value can be left blank for *SYSBAS iASP.
The previous form and underlying OAPI/SWAGGER are updated saved after the Done button is clicked.