Forum Discussion

tonante27's avatar
tonante27
New Member
2 years ago

Issue Creating AWS API Gateway with API definitions due to a UnMarshall Exception Return Code 400

When I configure the following new Swagger Hub Api integration I get the following error message:

 

 

 

Create IntegrationUnable to unmarshall exception response with the unmarshallers provided (Service: AWSLambda; Status Code: 400; Error Code: ValidationException; Request ID: e90dc01e-4b64-4569-bdc1-e4d9b86edb70; Proxy: null)

 

 

 

I have selected Create AWP API Gateway with Lambda Sync

Here is my YAML/OpenAPI definition

 

 

 

openapi: 3.0.0
servers:
# Prospect API 1.1.0
  - url: https://dev-cnx-mass-prospects-apis
    description: Test server
  - url: https://prod-cnx-mass-prospects-apis
    description: Production server
info:
  version: 1.0.0
  title: dev-cnx-mass-prospects-apis
  description: >
    This is the CNX MASS Prospect api. It deals with creating/posting/deleteing and patching CNE MAS Prospects.
paths:
  /prospect/search:
    get:
      tags:
        - Prospect > Search
      summary: Prospect Search using address and zip as mKey
      parameters:
        - name: address
          in: query
          description: Enter a Single street 
          required: true
          schema:
            type: string
        - name: zip
          in: query
          description: Enter a Zip code
          required: true
          schema:
            type: string
            
      responses:
        '200':
          description: "Successfully Retrieved."
          content:
            application/json:
              schema:
               $ref: '#/components/requestBodies/Prospect'
        '400':
            description: Problem with query parameter
        '403':
          $ref: "#/components/responses/ForbiddenError"         
          
  /prospect/update:
    put:
      tags:
      - prospect update
      summary: Prospect Search using address and zip as mKey and then update an existing record having that mKey
      operationId: "update prospects suing address and zip parameters"
      parameters:
      - name: "address"
        in: "query"
        required: true
        schema:
          type: "string"
      - name: "zip"
        in: "query"
        required: true
        schema:
          type: "string"
      responses:
        "200":
          description: "Record updated successfully."
        "404":
          description: "Not found"
          content: {}
        "409":
          description: "Conflict"
          content: {}
        "500":
          description: "Server crashed for some reason"
          content: {}
  
  /prospect/remove:
    delete:
      tags:
      - prospect update
      summary: Prospect Search using address and zip as mKey and then deletes an existing record having that mKey
      operationId: "delete prospects suing address and zip parameters"
      parameters:
      - name: "address"
        in: "query"
        required: true
        schema:
          type: "string"
      - name: "zip"
        in: "query"
        required: true
        schema:
          type: "string"
      responses:
        "200":
          description: "Record deleted successfully."
        "404":
          description: "Not found"
          content: {}
        "409":
          description: "Conflict"
          content: {}
        "500":
          description: "Server crashed for some reason"
          content: {}
components:
  responses:
    ForbiddenError:
      description: API key is missing or invalid
      headers:
        X-API-KEY:
          description: Cogensia provided API Key
          schema:
            type: string
  requestBodies:
    Prospect:
       description: A Prospect object
       content:
            application/json:
              schema:
                 type: object
                 properties:
                      lastModifiedDate:
                        type: string
                        example: '2019-09-17T16:09:32Z'
                        description: When the record was last modified.
                      mKey5:
                        type: string
                        example: '1008DIXSON106514'
                        description: The mKey5 of a record.
                      householdInfo:
                        type: object
                        properties:
                            lifedriver_class:
                              type: string
                              example: 'Red'
                              description: Indicator for the type of life drver.
                            cac_demo_income:
                                type: string
                                example: '$25000'
                                description: The household income.
                            cac_hh_home_own:
                                type: string
                                example: 'Owner'
                                description: The household owner.
                            CAC_HH_HOMEHEATINDICATOR:
                                type: string
                                example: 'Unknown'
                                description: The home heat indicator devices for a house
                            cac_home_sq_foot_num:
                                type: string
                                example: '176.20'
                                description: sqaure footage sice of a house
                            cac_demo_num_kids:
                                type: string
                                example: '4'
                                description: The # of kids per householld
                            cac_demo_num_in_hh:
                                type: string
                                example: '4'
                                description: The # of family members in a household
                            cac_demo_num_adults:
                                type: string
                                example: '2'
                                description: The # of adult members in a household
                            cac_silh_super:
                                type: string
                                example: 'Struggeling Singles'
                                description: Household category 
                            cac_int_112:
                                type: string
                                example: '0'
                                description: Household 112 indicator 
                            cac_demo_hoh_age:
                                type: string
                                example: '45-54 Years Old'
                                description: Household member's Age 
                            CAC_HH_RES_LENGTH:
                                type: string
                                example: '45-54 Years Old'
                                description: The age of the home 
                            CAC_HH_AIRCONDITIONING:
                                type: string
                                example: 'Unknown/Yes/No'
                                description: Does the home have airconditioning
                            serviceAddress:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    address:
                                      type: string
                                      example: '123 Main St.'
                                      description: Street Address 1 for the address of the record.
                                    city:
                                      type: string
                                      example: 'Chesapeake Beach'
                                      description: City for the address of the record.
                                    state:
                                      type: string
                                      example: 'MD'
                                      description:  State for the address of the record.
                                    zip:
                                      type: string
                                      example: '20732'
                                      description: Zip code for the address of the record.

 

 

 

 

1 Reply

  • tonante727's avatar
    tonante727
    Occasional Contributor

    The issue is probably resides in the Swagger Hub User Role. If you create an Integration for AWS API Gateway with Lambda Sync:,

    1. Do not add any info for the Role step.
    2. Verify that the gateway adds all your paths from the OpenAPI3 Swagger YAML definition
    3. Create you Lambda separately since the ones auto-generated are mockups anyway.
    4. The take a look at the permissions on your SwaggerHug user and see which ones will allow Lambda generation if that's prefered.
    5.