5 Replies Latest reply on Oct 16, 2020 8:19 AM by Craig Uss

    REST V2 Connector - getOperationList NullPointer

    Craig Uss New Member

      Trying to setup the REST V2 IICS connector within our project. The Connector passes test validation successfully. However when building a target object in a mapping, a pop-up is received when trying to select the Operation, saying "java.lang.NullPointerException"

       

      Use Case:

      (E) - xtract a flat file

      (T) - ransform the data by adding some analytics

      (L) - oad the record through the REST V2 endpoint using a POST

       

      The Rest endpoint has been defined with Swagger 2.0 and tried with OpenApi 3. Both resulted in the error. The error itself is attached

       

        • 1. Re: REST V2 Connector - getOperationList NullPointer
          Ashwini Ramakrishna Guru

          Hello Craig,

           

          The Null pointer was happening while populating operation info.

           

          For the same we need valid operation elements in the swagger, of which there aren't any because of the below reason.

           

          The swagger file used in the Rest V2 connection was invalid according to Swagger specifications, as it is missing operationId field. This is a must field for the adapter to process any endpoint.

           

          Please find further details at:

           

          http://swagger.io/specification/

           

          The operationId is described as:

           

          operationId: string: Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.

           

          -> Please work with the endpoint team get the swagger generated according to Swagger specifications or use Informatica's Swagger generator tool to generate the swagger it will take of all the required parameters.

           

           

          You should see the entries for operationId as below if it is defined in the swagger.

           

          ================

           

          /v1/object/subscription-product-feature/{id}": {

           

                "get": {

           

                  "summary": "CRUD: Retrieve SubscriptionProductFeature",

           

                  "operationId": "Object_GETSubscriptionProductFeature",

           

                  "description": "",

           

                  "tags": [

           

                    "Subscription Product Features"

           

                  ],

          • 2. Re: REST V2 Connector - getOperationList NullPointer
            Craig Uss New Member

            Thank you for the reply Ashwini,

             

            I am the endpoint developer in this case. I can confirm that the operationId is set for all operations within the swagger spec. What else could cause this error?

            • 3. Re: REST V2 Connector - getOperationList NullPointer
              Akshaye Shreenithi Kirupa Guru

              Hi Craig

               

              Can you please try generating the swagger for REST V2 connection using IICS swagger utility and see if that helps. Please note OpenApi 3 is not supported, the webservice needs to be defined with Swagger 2.0 .

              • 4. Re: REST V2 Connector - getOperationList NullPointer
                Jharana Patra Guru

                Hi Craig,

                 

                Please share the swagger file if the above mentioned workaround doesn't work for you.

                • 5. Re: REST V2 Connector - getOperationList NullPointer
                  Craig Uss New Member

                  Sure, here is the endpoint swagger

                   

                  inuser453295

                  inuser514797

                   

                  {

                      "basePath": "/api/v1/informatica-data-service/",

                      "definitions": {

                          "ApiResponse": {

                              "properties": {

                                  "errorMessages": {

                                      "items": {

                                          "type": "string"

                                      },

                                      "type": "array"

                                  },

                                  "messages": {

                                      "items": {

                                          "type": "string"

                                      },

                                      "type": "array"

                                  },

                                  "pagination": {

                                      "$ref": "#/definitions/Pagination"

                                  },

                                  "result": {

                                      "items": {

                                          "type": "object"

                                      },

                                      "type": "array"

                                  }

                              },

                              "type": "object"

                          },

                          "Pagination": {

                              "properties": {

                                  "limit": {

                                      "format": "int32",

                                      "type": "integer"

                                  },

                                  "offset": {

                                      "format": "int32",

                                      "type": "integer"

                                  },

                                  "total": {

                                      "format": "int32",

                                      "type": "integer"

                                  }

                              },

                              "type": "object"

                          }

                      },

                      "host": "",

                      "info": {

                          "contact": {

                              "email": "",

                              "name": ""

                          },

                          "description": "",

                          "license": {},

                          "title": "Informatica Data Services",

                          "version": "1.0.0"

                      },

                      "paths": {

                          "/elasticsearch/{x-Tenant-Id}": {

                              "get": {

                                  "consumes": [

                                      "application/json"

                                  ],

                                  "description": "Retrieve the ES record using internal ID",

                                  "operationId": "getESRecordById",

                                  "parameters": [

                                      {

                                          "description": "Name of Index",

                                          "in": "query",

                                          "name": "indexName",

                                          "required": true,

                                          "type": "string"

                                      },

                                      {

                                          "default": "",

                                          "description": "Tenant ID",

                                          "in": "path",

                                          "name": "x-Tenant-Id",

                                          "required": false,

                                          "type": "string"

                                      },

                                      {

                                          "description": "ID of Record",

                                          "in": "query",

                                          "name": "id",

                                          "required": false,

                                          "type": "string"

                                      }

                                  ],

                                  "produces": [

                                      "*/*"

                                  ],

                                  "responses": {

                                      "200": {

                                          "description": "Record Found by ID",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      },

                                      "204": {

                                          "description": "No Record Found",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      },

                                      "400": {

                                          "description": "Invalid request.(invalid request body, etc).",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      },

                                      "401": {

                                          "description": "Unauthorized"

                                      },

                                      "403": {

                                          "description": "Forbidden"

                                      },

                                      "404": {

                                          "description": "Not Found"

                                      },

                                      "500": {

                                          "description": "Internal server error",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      }

                                  },

                                  "summary": "Retrieve record by id given an index name",

                                  "tags": [

                                      "elastic-dao"

                                  ]

                              },

                              "post": {

                                  "consumes": [

                                      "application/json"

                                  ],

                                  "description": "Given an index name and x-Tenant-Id service will try to save JSON Body to index returning the ID",

                                  "operationId": "addESRecord",

                                  "parameters": [

                                      {

                                          "description": "Name of Index",

                                          "in": "query",

                                          "name": "indexName",

                                          "required": true,

                                          "type": "string"

                                      },

                                      {

                                          "default": "",

                                          "description": "Tenant ID",

                                          "in": "path",

                                          "name": "x-Tenant-Id",

                                          "required": false,

                                          "type": "string"

                                      },

                                      {

                                          "description": "Add JSON document to index",

                                          "in": "body",

                                          "name": "body",

                                          "required": true,

                                          "schema": {

                                              "type": "string"

                                          }

                                      }

                                  ],

                                  "produces": [

                                      "*/*"

                                  ],

                                  "responses": {

                                      "200": {

                                          "description": "OK",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      },

                                      "201": {

                                          "description": "Record successfully Created.",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      },

                                      "400": {

                                          "description": "Error messages attached in header (errorMessages), invalid request.(invalid request body, etc)",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      },

                                      "401": {

                                          "description": "Unauthorized"

                                      },

                                      "403": {

                                          "description": "Forbidden"

                                      },

                                      "404": {

                                          "description": "Not Found"

                                      },

                                      "500": {

                                          "description": "internal server error",

                                          "schema": {

                                              "$ref": "#/definitions/ApiResponse"

                                          }

                                      }

                                  },

                                  "summary": "Persist a new record into a target Index",

                                  "tags": [

                                      "elastic-dao"

                                  ]

                              }

                          }

                      },

                      "swagger": "2.0",

                      "tags": [

                          {

                              "description": "Elastic Api Controller",

                              "name": "elastic-api-controller"

                          }

                      ]

                  }