MDRest4i SDK
MDRest4i Software Development Kit (SDK) provides automation for building and documenting REST Provider and Consumer programs.
It is a web application that is hosted on the IBM i with all of the extraction, parsing, generation and data being executed/stored on the IBM i via REST API's, built using MDRFRAME.
Info
This sections provides an overview on the MDRest4i SDK. Specific details about each screen are available as online help from within the UI itself by selecting the "?" icon on any given page.
The main parts of the SDK are as follows:
SDK Web UI
A graphical, form-based web UI hosted from the IBM i HTTP server. Simplifies the editing of SWAGGER definitions, used to generate Consumer and Provider programs in RPG/COBOL. SWAGGER editor and SWAGGER UI are apps are embedded in the SDK UI, which provides a rich set of additional validation and testing capabilities to the SDK.
Form-based editing in the SDK UI
SWAGGER/OAPi
Consumer and Provider definitions are edited via the web UI and submitted to the REST API code generator.
SWAGGER definitions can be edited from basic templates provided in the SDK, imported from externally created SWAGGER/OAPI docs, or imported from POSTMAN collections.
Extensions to SWAGGER are used by the SDK to specify information needed by the code generators, such as objects names, IBM i field attributes, parsing methods, etc... below is an example of the main MDRGenoptions extension added to the SWAGGER definition by the SDK:
x-mdrGen:
RESTtype: provider
genTemplate: RPGLE_EACH
language: RPGLE
jwt: 'N'
mdrGenOptions:
post:
object: /QSYS.LIB/MDRTST14.LIB/api0077.PGM
source: /QSYS.LIB/MDRTST14.LIB/TUTORIALS.FILE/api0077.MBR
copybookPath: ''
lastmdrGen: '2024-03-07T06:42:48.541Z'
payloads:
format: JSON
parseMethod: DATA-INTO
genMethod: DATA-GEN
parseIntoFormat: UTF-8
SWAGGER Schema Extractors
A set of ILE REST API's called by the web UI of via IBM i commands, that generate the SWAGGER schemas and merge them into the Consumer/Provider SWAGGER definitions.
Automated SWAGGER Schema Extraction
Consumer & Provider Generators
A Rest API and ILE generator plugins, that accept SWAGGER from the SDK web UI, and generate RPGLE or COBOL code as Consumer or Provider programs.
The SDK web UI provides the user with Consumer or Provider SWAGGER(OAPI) templates
SDK User Management
Info
SDK Portal Users and SDK Console users are shared.
SDK Users have a "User Class" assigned to them. SDK users must exist as IBM i users, before registering. No special IBM i authority is required for an SDK user
The MDRST/MDRSDKINS installation command requires a user name (ADMPRF) to use as the default SDK Administrator.
This user can be used to login to the SDK Web UI for the first time.
New users can then use the "Sign Up " option at the SDK Login screen.
New users must then be authorized by an Admin level user, after registering. This is accomplished via the SDK Site Admin, Manage Users section, clicking on the locked padlock icon, to "unlock" the user.