Difference between revisions of "I2Rest PCML syntax"

From i2Rest
Jump to: navigation, search
(Open Api 3.0 tag)
Line 34: Line 34:
 
! style="width: 10%"| Field Name!! style="width: 20%"| Type !!  Description
 
! style="width: 10%"| Field Name!! style="width: 20%"| Type !!  Description
 
|-
 
|-
|title || string || REQUIRED. The title of the application.
+
|title || string || The title of the application.
 
|-
 
|-
 
|description || string || A short description of the application.
 
|description || string || A short description of the application.
Line 44: Line 44:
 
|license || License Object || The license information for the exposed API.
 
|license || License Object || The license information for the exposed API.
 
|-
 
|-
|version || string || REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).
+
|version || string || The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).
 
|-
 
|-

Revision as of 10:25, 14 May 2020


Additional PCML data tags

Three more attributes in PCML data tag were added in order to improve response processing on server side.
trimarray - specifies the path to programm, that should handle array been passed in current element.

 <data name="CCY"    type="char"  length="3" trimarray="/qsys.lib/%libl%.lib/jpcmlt_bl.pgm"/>

jpcmlt_bl -

jpcmlt_bl  parameters
 input:
     pointer on record to be processed
     record length
 output:
     error code?  

assert - specifies the path to programm, that should handle some way data passed in current element.

 <data name="ERMSG"       type="struct" usage="output"      struct="KSM" assert="/qsys.lib/%libl%.lib/jpcmla_eq.pgm" exclude="true"/> 

In the example above programm jpcmla_eq is used to process in ERMSG element. jpcmla_eq comes in the package with i2Rest Server.

jpcmla_eq parameters
 input:
     pointer on record to be processed
     record length
 output:
     error code  

jpcmla_eq examines record pointer to which was passed with dirst input. If KSM or errormessage is found, jpcmla_eq returns error code and stops handling PCML tags. That prevents possible failures, which could occur if incorrect data was returned by the colled API.

exclude - attribute applicable for usage="output" or usage="inputoutput" elements. Elements with exclude attribute will be not included into server response.

Open Api 3.0 tag

This tag is not about processing of remote program call like native PCML tags. It contains API description according to OpenAPI Specification (OAS), which allows both humans and computers to discover and understand the capabilities of the service without access to source code or documentation. An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.

Field Name Type Description
title string The title of the application.
description string A short description of the application.
termsOfService string A URL to the Terms of Service for the API. MUST be in the format of a URL.
contact Contact Object The contact information for the exposed API.
license License Object The license information for the exposed API.
version string The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).