API/Macro Call Extensibility Examples

API Call/Macro Extensibility Use Cases

The purpose of this chapter is to help users understand how the Configuration files must be created in order to integrate their business specific cases in the analysis.

API Programs for calling utilities Use case

This use case is created to cover the situation when the API programs are used to call a program that is defined through one of the initial call parameters. The following represents the PSAMPLE COBOL program:
IDENTIFICATION DIVISION.                                        
       PROGRAM-ID. PSAMPLE.                                             
      *                                                                
       ENVIRONMENT DIVISION.                                           
      *                                                                
       DATA DIVISION.                                                  
      *                                                                
       WORKING-STORAGE SECTION.                                        
        01 VAR1 PIC X(06).
        01 VAR2 PIC X(06).
        01 VAR3 PIC X(08).
        01 VAR4 PIC X(08).
        01 X PIC X(08).
       
       PROCEDURE DIVISION. 
        MOVE  'PGACCESS'  TO VAR1
        MOVE  'VALUE'  TO VAR2 
        CALL 'API1' USING VAR1, VAR2, VAR3, VAR4.

The PSAMPLE COBOL program contains a call to a specific API program named API1.

In case a call to the API1 program has to be interpreted as a call to the value of the first call parameter (VALUE1) , the following configuration files containing the rules for the new resolution are to be used.

Note: The API_Config.json file specifies that the fist parameter has to be saved with its value while for the rest of parameters there is no need for their values.
{
  "info": {
    "version": "5.0.3"
  },
    "extensions": 
    [{
           "apiKey": "a1",
           "name": "API1",
           "type": "call",
           "parameters":
           [ 
              {
                 "position":1,
                 "label": "program",
                 "resolve": true
              }
           ]
        }
       
    ]
}
The ue-config.json file specifies the type of user exit file and the path where the user exit file is located.
{
  "schemaVersion":"1.0.1",
  "documentVersion":"1.0.1",
  "ueConfig" :[
   {"name": "uejson",
    "type":"file-json",
    "location":"/bobz-understand/projects/ProjectName/API Config/Resolutions/resolution1.json",
    "appliesTo":["a1"]
   }
]
}
In the preceding example, </bobz-understand/projects/ProjectName/API Config/Resolutions/> is the path where the resolution1.json file is saved. You must replace it with the actual path where the resolution1.json file is saved.
The resolution.json file specifies that the API1 call is replaced with a call to a COBOL program, it's name is resolved in the first parameter.
{
    "schemaVersion": "1.0.2",
    "documentVersion": "1.0.2",
    "entries": [{
        "input": {
            "apiKey": "a1",
            "apiText": "API1",
            "params": [{
                    "paramKey": "program",
                    "paramMode": "byValue"
                }
            ]
        },
        "resolutions": [{
            "action": "call",           
            "target": {
                "resourceType": "CobolProgram",
                "paramKey": "program",
                "paramMode": "byValue",               
                "read": true
            }
        }]
    }]
}

Extensibility JSON Schema (applied for COBOL and PL/I, not yet for HLASM and JCL)

API Config JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Extensibility extensions definition file",
    "type": "object",
    "properties": {
        "info": {
            "type": "object",
            "properties": {
                "version": {
                    "type": "string",
                    "description": "The extension file version",
                    "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+"
                }
            },
            "required": [
                "version"
            ]
        },
        "extensions": {
            "type": "array",
            "minItems": 1,
            "items": {
                "$ref": "#/definitions/Extension"
            }
        }
    },
    "required": [
        "info",
        "extensions"
    ],
    "definitions": {
        "Extension": {
            "oneOf": [
                {
                    "$ref": "#/definitions/ExtensionType1"
                },
                {
                    "$ref": "#/definitions/ExtensionType2"
                },
                {
                    "$ref": "#/definitions/ExtensionType3"
                },
            {
                    "$ref": "#/definitions/ExtensionType4"
                }
            ]
        },
        "LocatorType1": {
            "type": "object",
            "description": "Locator specifying the parameter value from a record's child",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the record child from which to take the parameter value",
                    "minLength": 1
                }
            },
            "required": [
                "name"
            ],
            "additionalProperties": false
        },
        "LocatorType2": {
            "type": "object",
            "description": "Locator specifying the parameter value by offset and length",
            "properties": {
                "offset": {
                    "type": "integer",
                    "description": "Starting offset for the value",
                    "minimum": 0
                },
                "length": {
                    "type": "integer",
                    "description": "Length of the value to be read",
                    "minimum": 0
                }
            },
            "required": [
                "offset",
                "length"
            ],
            "additionalProperties": false
        },
        "ExtensionType1": {
            "type": "object",
            "properties": {
                "apiKey": {
                    "type": "string",
                    "minLength": 1
                },
                "name": {
                    "type": "string",
                    "minLength": 1
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "call"
                    ],
                    "description": "Extension for call statements",
                    "minLength": 1
                },
                "parameters": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "$ref": "#/definitions/ParameterType1"
                    }
                }
            },
            "required": [
                "apiKey",
                "name",
                "type",
                "parameters"
            ],
            "additionalProperties": false
        },
        "ExtensionType2": {
          "type": "object",
          "properties": {
            "apiKey": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "enum": [
                "cics"
              ],
              "description": "Extension for cics statements",
              "minLength": 1
            },
            "parameters": {
              "type": "array",
              "minItems": 1,
              "items": {
                "$ref": "#/definitions/ParameterType2"
              }
            }
          },
          "required": [
            "apiKey",
            "name",
            "type",
            "parameters"
          ],
          "additionalProperties": false
        },
         "ExtensionType3": {
          "type": "object",
          "properties": 
          {
            "apiKey": 
            {
              "type": "string",
              "minLength": 1
            },
            "name": 
            {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "enum": [
                "JclPgmCall"
              ],
              "description": "Extension for JCL call statements",
              "minLength": 1
            },
            "parameters": {
              "type": "array",
              "minItems": 1,
              "items": {
                "$ref": "#/definitions/ParameterType3"
              }
            }
          },
            "required": [
                "apiKey",
                "name",
                "type",
                "parameters"
            ],
            "additionalProperties": false
          },
        "ExtensionType4": {
          "type": "object",
          "properties": 
          {
            "apiKey": 
            {
              "type": "string",
              "minLength": 1
            },
            "name": 
            {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "enum": [
                "JclPgmCallParm"
              ],
              "description": "Extension for JCL call statements with PARM",
              "minLength": 1
            },
            "parameters": {
              "type": "array",
              "minItems": 1,
              "items": {
                "$ref": "#/definitions/ParameterType4"
              }
            }
          },
            "required": [
                "apiKey",
                "name",
                "type",
                "parameters"
            ],
            "additionalProperties": false
          },
        "ParameterType1": {
            "type": "object",
            "description": "Parameter for call statements",
            "properties": {
                "position": {
                    "type": "integer",
                    "description": "Position of the parameter in the call",
                    "minimum": 1
                },
                "label": {
                    "type": "string",
                    "description": "Identifier for the parameter",
                    "minLength": 1
                },
                "resolve": {
                    "type": "boolean",
                    "description": "Specify whether to determine the values of the parameter or not",
                    "default": true
                },
                "optional": {
                    "type": "boolean",
                    "description": "Specify whether the parameter is optional or not",
                    "default": false
                },
                "locator": {
                    "oneOf": [
                        {
                            "$ref": "#/definitions/LocatorType1"
                        },
                        {
                            "$ref": "#/definitions/LocatorType2"
                        }
                    ]
                }
            },
            "required": [
                "position",
                "label",
                "resolve"
            ],
            "additionalProperties": false
        },
        "ParameterType2": {
            "type": "object",
            "description": "Parameter for CICS statements",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the parameter in the CICS statement",
                    "minLength": 1
                },
                "label": {
                    "type": "string",
                    "description": "Identifier for the parameter",
                    "minLength": 1
                },
                "resolve": {
                    "type": "boolean",
                    "description": "Specify whether to determine the values of the parameter or not",
                    "default": true
                },
                "optional": {
                    "type": "boolean",
                    "description": "Specify whether the parameter is optional or not",
                    "default": false
                },
                "locator": {
                    "oneOf": [
                        {
                            "$ref": "#/definitions/LocatorType1"
                        },
                        {
                            "$ref": "#/definitions/LocatorType2"
                        }
                    ]
                }
            },
            "required": [
                "name",
                "label",
                "resolve"
            ],
            "additionalProperties": false
        },

        "ParameterType3": {
            "type": "object",
            "description": "Parameter for JCL calls",
            "properties": {
              "name": 
              {
                "type": "string",
                "description": "Name of the parameter in the JCL call",
                "minLength": 1
              },
              "label": 
              {
                "type": "string",
                "description": "Identifier for the parameter",
                "minLength": 1
              },
             "optional": {
                    "type": "boolean",
                    "description": "Specify whether the parameter is optional or not",
                    "default": false
             }
            },
            "required": [
                "name",
                "label"
            ],
            "additionalProperties": false
        },
      "ParameterType4": {
            "type": "object",
            "description": "Parameter for JCL calls with PARM",
            "properties": {
              "position": 
              {
                "type": "integer",
                "description": "Position of the parameter in the PARM attribute of the JCL call",
                "minLength": 1
              },
              "label": 
              {
                "type": "string",
                "description": "Identifier for the parameter",
                "minLength": 1
              },
             "optional": {
                    "type": "boolean",
                    "description": "Specify whether the parameter is optional or not",
                    "default": false
             }
            },
            "required": [
                "position",
                "label"
            ],
            "additionalProperties": false
        }
    }
}
User Exit Config JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "version": "1.0.1",
    "type": "object",
    "description": "An ordered list of user exits",
    "properties": {
        "schemaVersion": {
            "description": "This json schema version",
            "$ref": "#/definitions/versionDef"
        },
        "documentVersion": {
            "description": "The user exit json file version",
            "$ref": "#/definitions/versionDef"
        },
        "ueConfig": {
            "type": "array",
            "description": "An array which contains user exit configurations",
            "items": {
                "type": "object",
                "description": "An user exit configuration object.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "A name for this user exit configuration."
                    },
                    "type": {
                        "type": "string",
                        "description": "The user exit type",
                        "enum": [
                            "file-json",
                            "utility",
                            "dependency-file-json",
                            "dependency-utility",
                            "jcl-file-json",
                            "jcl-utility"
                        ]
                    },
                    "location": {
                        "type": "string",
                        "description": "The path of the file containing the resolutions (applies for file-json type only)."
                    },
                    "appliesTo": {
                        "type": "array",
                        "description": "An array of API (defined in API config json) to which this user-exit is applied.",
                        "items": {
                            "type": "string",
                            "description": "An extensibility API key as defined in the API config json file."
                        },
                        "minItems": 1,
                        "uniqueItems": true
                    },
                    "command": {
                        "type": "array",
                        "description": "An array of strings used to call an external utility in order to obtain the user exit resolutions.",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "name",
                    "type",
                    "appliesTo"
                ],
                "uniqueItems": true
            }
        }
    },
    "required": [
        "ueConfig",
        "schemaVersion",
        "documentVersion"
    ],
    "definitions": {
        "versionDef": {
            "type": "string",
            "description": "Schema/Document versioning pattern",
            "pattern": "^[0-9]{1,3}\\.[0-9]{1,3}(\\.[0-9]{1,3})?$"
        }
    }
}
JSON file based User Exit Resolutions JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "version": "1.0.2",
    "type": "object",
    "description": "The json schema for a file-json based resolutions.",
    "properties": {
        "schemaVersion": {
            "description": "This json schema version.",
            "$ref": "#/definitions/versionDef"
        },
        "documentVersion": {
            "description": "The user exit json file version.",
            "$ref": "#/definitions/versionDef"
        },
        "entries": {
            "type": "array",
            "description": "An array containing the user exit content.",
            "items": {
                "type": "object",
                "description": "A user exit content object.",
                "properties": {
                    "resolutions": {
                        "type": "array",
                        "description": "An array which contains the user exit resolution objects.",
                        "items": {
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/localResolutionDef"
                                },
                                {
                                    "$ref": "#/definitions/externalResolutionDef"
                                },
                                {
                                    "$ref": "#/definitions/callLocalResolutionDef"
                                },
                                {
                                    "$ref": "#/definitions/callExternalResolutionDef"
                                }
                            ]
                        }
                    },
                    "input": {
                        "type": "object",
                        "description": "An object which contains the inputs for the user exit.",
                        "properties": {
                            "apiKey": {
                                "type": "string",
                                "description": "The parameter key as defined in the API config json."
                            },
                            "apiText": {
                                "type": "string",
                                "description": "The name of the API program as defined in the API config json."
                            },
                            "params": {
                                "type": "array",
                                "description": "An array of 'value' objects definitions. The number and the order of the items MUST be the same with the number and the order of the parameters defined in the API config json",
                                "items": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/definitions/paramValue"
                                        },
                                        {
                                            "$ref": "#/definitions/directValue"
                                        },
                                        {
                                            "$ref": "#/definitions/optionalValue"
                                        }
                                    ]
                                }
                            }
                        },
                        "required": [
                            "apiKey",
                            "params"
                        ],
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false,
                "required": [
                    "resolutions",
                    "input"
                ]
            }
        }
    },
    "required": [
        "entries",
        "schemaVersion",
        "documentVersion"
    ],
    "definitions": {
        "versionDef": {
            "type": "string",
            "description": "A schema/document versioning pattern.",
            "pattern": "^[0-9]{1,3}\\.[0-9]{1,3}(\\.[0-9]{1,3})?$"
        },
        "externalActionsDef": {
            "description": "",
            "type": "string",
            "enum": [
                "CICSStart",
                "CICSReturn",
                "IMSStartTransaction"
            ]
        },
        "localActionsDef": {
            "description": "",
            "type": "string",
            "enum": [
                "CICSStart",
                "CICSReturn",
                "SQLSelect",
                "SQLInsert",
                "SQLDelete",
                "SQLUpdate",
                "FileRead",
                "FileWrite",
                "FileRewrite",
                "FileDelete",
                "CICSFileRead",
                "CICSFileWrite",
                "CICSFileRewrite",
                "CICSFileDelete",
                "CICSSendMap",
                "CICSReceiveMap",
                "IMSSendMap",
                "IMSReceiveMap",
                "IMSStartTransaction",
                "IMSDBRead",
                "IMSDBReadNext",
                "IMSDBInsert",
                "IMSDBDelete",
                "IMSDBUpdate"
            ]
        },
        "paramValue": {
            "type": "object",
            "description": "A generic 'value' object which allows the user exit to define values for the resolution or the input values with references to the paramKey.",
            "properties": {
                "paramKey": {
                    "type": "string",
                    "description": "The parameter key as defined in the API config json file."
                },
                "paramMode": {
                    "type": "string",
                    "description": "A marker which defines how the parameter value is read by the resolver.",
                    "enum": [
                        "byValue",
                        "byRef"
                    ]
                }
            },
            "additionalProperties": false,
            "required": [
                "paramKey",
                "paramMode"
            ]
        },
        "directValue": {
            "type": "object",
            "description": "A generic 'value' object which allows the user exit to define values for the resolution or the input values without refererring to a specific paramKey.",
            "properties": {
                "value": {
                    "type": "string",
                    "description": "The value for this 'value' object."
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        },
        "optionalValue": {
            "type": "object",
            "description": "A generic 'value' object which allows the user exit to define values for the input values which will be ignored by the Resolver",
            "properties": {
                "ignore": {
                    "type": "boolean",
                    "description": "If true the 'value' object MUST be ignored by the Resolver."
                }
            },
            "additionalProperties": false,
            "required": [
                "ignore"
            ]
        },
        "resourceTypeDef": {
            "type": "object",
            "description": "An object which will contain a resource type definition for resolutions.",
            "properties": {
                "read": {
                    "type": "boolean",
                    "description": "A marker for the resource behavior (true: the resource is read, false - the resource is written.)"
                },
                "resourceType": {
                    "type": "string",
                    "description": "The resource type",
                    "enum": [
                        "CobolProgram",
                        "PL/1Program",
                        "Variable",
                        "CICSTran",
                        "SQLTable",
                        "SQLField",
                        "File",
                        "CICSMap",
                        "IMSMessageDescriptor",
                        "IMSTransaction",
                        "IMSDBSegment"
                    ]
                },
                "paramKey": {
                    "type": "string",
                    "description": "The parameter key as defined in the API config json file."
                },
                "paramMode": {
                    "type": "string",
                    "description": "A marker which defines how the parameter value is read by the resolver.",
                    "enum": [
                        "byValue",
                        "byRef"
                    ]
                },
                "qualifiers": {
                    "type": "array",
                    "description": "An array of strings. The strings will be used to qualify the resource.",
                    "items": {
                        "type": "string",
                        "description": "A string qualifier."
                    }
                },
                "value": {
                    "type": "string",
                    "description": "A string value for the resource type."
                },
                "annText": {
                       "type": "string",
                       "description": "A string which defines the text of the annotation."
               },
               "annKeyword": {
                       "type": "string",
                       "description": "A string which defines the key of the annotation."
               }
            },
            "additionalProperties": false
        },
        "clausesDef": {
            "type": "array",
            "description": "An array containing SQL statements related options.",
            "items": {
                "type": "object",
                "description": "",
                "properties": {
                    "clause": {
                        "type": "string",
                        "description": "The relationship between the 'from' and the 'to' 'value' objects.",
                        "enum": [
                            "into",
                            "where",
                            "set"
                        ]
                    },
                    "from": {
                        "description": "A SQLField value object",
                        "$ref": "#/definitions/resourceTypeDef"
                    },
                    "to": {
                        "description": "A host variable 'value' object.",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                },
                "additionalProperties": false
            }
        },
        "targetDef": {
            "description": "The targeted resource (if any). Will be deprecated in the next versions.",
            "$ref": "#/definitions/resourceTypeDef"
        },
        "localResolutionDef": {
            "properties": {
                "action": {
                    "$ref": "#/definitions/localActionsDef"
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                },
                "clauses": {
                    "$ref": "#/definitions/clausesDef"
                }
            },
            "additionalProperties": false,
            "required": [
                "action"
            ]
        },
        "externalResolutionDef": {
            "properties": {
                "action": {
                    "$ref": "#/definitions/externalActionsDef"
                },
                "location": {
                    "type": "string",
                    "description": "A string which defines the location (another project or a CICS region) where the API action is performed."
                },
                "locationType": {
                    "type": "string",
                    "description": "The  project name or a CICS region.",
                    "enum": [
                        "application",
                        "CICSRegion"
                    ]
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                }
            },
            "additionalProperties": false,
            "required": [
                "action", "location", "locationType"
            ]
        },
        "callLocalResolutionDef": {
            "properties": {
                "action": {
                    "enum": [
                        "call"
                    ]
                },
                "target": {
                    "$ref": "#/definitions/targetDef"
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                }
            },
            "additionalProperties": false,
            "required": [
                "action",
                "target"
            ]
        },
        "callExternalResolutionDef": {
            "properties": {
                "action": {
                    "enum": [
                        "call"
                    ]
                },
                "location": {
                    "type": "string",
                    "description": "A string which defines the location (another  project or a CICS region) where the API action is performed."
                },
                "locationType": {
                    "type": "string",
                    "description": "The  project name or a CICS region.",
                    "enum": [
                        "application",
                        "CICSRegion"
                    ]
                },
                "target": {
                    "$ref": "#/definitions/targetDef"
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                }
            },
            "additionalProperties": false,
            "required": [
                "action",
                "location",
                "locationType",
                "target"
            ]
        }
    }
}
Utility input JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "version": "1.0.1",
    "type": "object",
    "description": "The json schema for the utility input data.",
    "properties": {
        "schemaVersion": {
            "$ref": "#/definitions/versionDef"
        },
        "inputs": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "apiKey",
                    "apiText",
                    "params",
                    "id"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "An unique identifier of the input instance."
                    },
                    "apiKey": {
                        "type": "string",
                        "description": "The parameter key as defined in the API config json."
                    },
                    "apiText": {
                        "type": "string",
                        "description": "The name of the API program as defined in the API config json."
                    },
                    "params": {
                        "type": "array",
                        "description": "An array containing tuples collected for the parameters defined in the API config json.",
                        "items": {
                            "type": "object",
                            "description": "A tuple which defines an input for the utility.",
                            "additionalProperties": false,
                            "required": [
                                "paramKey",
                                "paramMode",
                                "paramPos"
                            ],
                            "properties": {
                                "paramKey": {
                                    "type": "string",
                                    "description": "The parameter key as defined in the API config json."
                                },
                                "paramPos": {
                                    "type": "integer",
                                    "description": "The parameter position as defined in the API config json"
                                },
                                "paramMode": {
                                    "type": "string",
                                    "description": "A marker which defines how the parameter value is read by the resolver.",
                                    "enum": [
                                        "byValue",
                                        "byRef"
                                    ]
                                },
                                "missing": {
                                    "type": "boolean",
                                    "description": "True if the parameter value is missing."
                                },
                                "value": {
                                    "type": "string",
                                    "description": "The parameter colected value."
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "required": [
        "inputs",
        "schemaVersion"
    ],
    "definitions": {
        "versionDef": {
            "type": "string",
            "description": "A schema/document versioning pattern.",
            "pattern": "^[0-9]{1,3}\\.[0-9]{1,3}(\\.[0-9]{1,3})?$"
        }
    }
}
Utility output JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "version": "1.0.2",
    "type": "object",
    "description": "The json schema for the utility output.",
    "properties": {
        "schemaVersion": {
            "description": "This json schema version.",
            "$ref": "#/definitions/versionDef"
        },
        "results": {
            "type": "array",
            "description": "An array containing the utility results.",
            "items": {
                "type": "object",
                "description": "An utility result object.",
                "properties": {
                    "inputId": {
                        "type": "string",
                        "description": "An unique identifier. Must be identical with the 'id' value of the correspondent utility input object."
                    },
                    "resolutions": {
                        "type": "array",
                        "description": "An array which contains the utility resolution objects.",
                        "items": {
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/localResolutionDef"
                                },
                                {
                                    "$ref": "#/definitions/externalResolutionDef"
                                },
                                {
                                    "$ref": "#/definitions/callLocalResolutionDef"
                                },
                                {
                                    "$ref": "#/definitions/callExternalResolutionDef"
                                }
                            ]
                        }
                    },
                    "input": {
                        "type": "object",
                        "description": "An object which contains the utility input data.",
                        "properties": {
                            "apiKey": {
                                "type": "string",
                                "description": "The parameter key as defined in the API config json."
                            },
                            "apiText": {
                                "type": "string",
                                "description": "The name of the API program as defined in the API config json."
                            },
                            "params": {
                                "type": "array",
                                "description": "An array of 'value' objects definitions. The number and the order of the items MUST be the same with the number and the order of the parameters defined in the API config json",
                                "items": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/definitions/paramValue"
                                        },
                                        {
                                            "$ref": "#/definitions/directValue"
                                        },
                                        {
                                            "$ref": "#/definitions/optionalValue"
                                        }
                                    ]
                                }
                            }
                        },
                        "required": [
                            "apiKey",
                            "params"
                        ],
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false,
                "required": [
                    "inputId",
                    "resolutions",
                    "input"
                ]
            }
        }
    },
    "required": [
        "results",
        "schemaVersion"
    ],
    "definitions": {
        "versionDef": {
            "type": "string",
            "description": "A schema/document versioning pattern.",
            "pattern": "^[0-9]{1,3}\\.[0-9]{1,3}(\\.[0-9]{1,3})?$"
        },
        "externalActionsDef": {
            "description": "",
            "type": "string",
            "enum": [
                "CICSStart",
                "CICSReturn",
                "IMSStartTransaction"
            ]
        },
        "localActionsDef": {
            "description": "",
            "type": "string",
            "enum": [
                "CICSStart",
                "CICSReturn",
                "SQLSelect",
                "SQLInsert",
                "SQLDelete",
                "SQLUpdate",
                "FileRead",
                "FileWrite",
                "FileRewrite",
                "FileDelete",
                "CICSFileRead",
                "CICSFileWrite",
                "CICSFileRewrite",
                "CICSFileDelete",
                "CICSSendMap",
                "CICSReceiveMap",
                "IMSSendMap",
                "IMSReceiveMap",
                "IMSStartTransaction",
                "IMSDBRead",
                "IMSDBReadNext",
                "IMSDBInsert",
                "IMSDBDelete",
                "IMSDBUpdate"
            ]
        },
        "paramValue": {
            "type": "object",
            "description": "A generic 'value' object which allows the user exit to define values for the resolution or the input values with references to the paramKey.",
            "properties": {
                "paramKey": {
                    "type": "string",
                    "description": "The parameter key as defined in the API config json file."
                },
                "paramMode": {
                    "type": "string",
                    "description": "A marker which defines how the parameter value is read by the resolver.",
                    "enum": [
                        "byValue",
                        "byRef"
                    ]
                }
            },
            "additionalProperties": false,
            "required": [
                "paramKey",
                "paramMode"
            ]
        },
        "directValue": {
            "type": "object",
            "description": "A generic 'value' object which allows the user exit to define values for the resolution or the input values without referrering to a specific paramKey.",
            "properties": {
                "value": {
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "value"
            ]
        },
        "optionalValue": {
            "type": "object",
            "description": "A generic 'value' object which allows the user exit to define values for the input values which will be ignored by the AD Resolver",
            "properties": {
                "ignore": {
                    "type": "boolean"
                }
            },
            "additionalProperties": false,
            "required": [
                "ignore"
            ]
        },
        "resourceTypeDef": {
            "type": "object",
            "description": "An object which will contain a resource type definition for resolutions.",
            "properties": {
                "read": {
                    "type": "boolean",
                    "description": "A marker for the resource behavior (true: the resource is read, false - the resource is written.)"
                },
                "resourceType": {
                    "type": "string",
                    "description": "The resource type",
                    "enum": [
                        "CobolProgram",
                        "PL/1Program",
                        "Variable",
                        "CICSTran",
                        "SQLTable",
                        "SQLField",
                        "File",
                        "CICSMap",
                        "IMSMessageDescriptor",
                        "IMSTransaction",
                        "IMSDBSegment"
                    ]
                },
                "paramKey": {
                    "type": "string",
                    "description": "The parameter key as defined in the API config json file."
                },
                "paramMode": {
                    "type": "string",
                    "description": "A marker which defines how the parameter value is read by the resolver.",
                    "enum": [
                        "byValue",
                        "byRef"
                    ]
                },
                "qualifiers": {
                    "type": "array",
                    "description": "An array of strings. The strings will be used to qualify the resource.",
                    "items": {
                        "type": "string",
                        "description": "A string qualifier."
                    }
                },
                "value": {
                    "type": "string",
                    "description": "A string value for the resource type."
                }
            },
            "additionalProperties": false
        },
        "clausesDef": {
            "type": "array",
            "description": "An array containing SQL statements related options.",
            "items": {
                "type": "object",
                "description": "",
                "properties": {
                    "clause": {
                        "type": "string",
                        "description": "The relationship between the 'from' and the 'to' 'value' objects.",
                        "enum": [
                            "into",
                            "where",
                            "set"
                        ]
                    },
                    "from": {
                        "description": "A SQLField value object",
                        "$ref": "#/definitions/resourceTypeDef"
                    },
                    "to": {
                        "description": "A host variable 'value' object.",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                },
                "additionalProperties": false
            }
        },
        "targetDef": {
            "description": "The targeted resource (if any). Will be deprecated in the next versions.",
            "$ref": "#/definitions/resourceTypeDef"
        },
        "localResolutionDef": {
            "properties": {
                "action": {
                    "$ref": "#/definitions/localActionsDef"
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                },
                "clauses": {
                    "$ref": "#/definitions/clausesDef"
                }
            },
            "additionalProperties": false,
            "required": [
                "action"
            ]
        },
        "externalResolutionDef": {
            "properties": {
                "action": {
                    "$ref": "#/definitions/externalActionsDef"
                },
                "location": {
                    "type": "string",
                    "description": "A string which defines the location (another project or a CICS region) where the API action is performed."
                },
                "locationType": {
                    "type": "string",
                    "description": "The project name or a CICS region.",
                    "enum": [
                        "application",
                        "CICSRegion"
                    ]
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                }
            },
            "additionalProperties": false,
            "required": [
                "action", "location", "locationType"
            ]
        },
        "callLocalResolutionDef": {
            "properties": {
                "action": {
                    "enum": [
                        "call"
                    ]
                },
                "target": {
                    "$ref": "#/definitions/targetDef"
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                }
            },
            "additionalProperties": false,
            "required": [
                "action",
                "target"
            ]
        },
        "callExternalResolutionDef": {
            "properties": {
                "action": {
                    "enum": [
                        "call"
                    ]
                },
                "location": {
                    "type": "string",
                    "description": "A string which defines the location (another project or a CICS region) where the API action is performed."
                },
                "locationType": {
                    "type": "string",
                    "description": "The project name or a CICS region.",
                    "enum": [
                        "application",
                        "CICSRegion"
                    ]
                },
                "target": {
                    "$ref": "#/definitions/targetDef"
                },
                "resources": {
                    "type": "array",
                    "description": "An array containing the user exit values for the given resolution.",
                    "items": {
                        "description": "",
                        "$ref": "#/definitions/resourceTypeDef"
                    }
                }
            },
            "additionalProperties": false,
            "required": [
                "action",
                "location",
                "locationType",
                "target"
            ]
        }
    }
}