cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Customer connector: Property "" type mismatch

I'm creating a custom connector from an OpenApi file and when I test an operation (GetAd)

GetAd_1.png

I  am getting a Schema Validation error Schema_validation_error.png

Two of my operations work but four do not

 Operations.png

The two that work do not expect parameters in the path.  The other four do.

I've searched this forum as well as Google searches but have been unable to find the issue.

The custom connector was created from an OpenApi file. The swagger follows.

 

{
  "swagger": "2.0",
  "info": {
    "title": "adman APIs",
    "description": "APIs available for adman",
    "version": "1.0.0"
  },
  "host": "myserver:10182",
  "schemes": [ "http" ],
  "basePath": "/web/services",
  "tags": [
    {
      "name": "adman APIs",
      "description": "APIs available for adman"
    }
  ],
  "definitions": {
    "adHdrDsTmp": {
      "type": "object",
      "properties": {
        "adType": {
          "type": "string",
          "maxLength": 1
        },
        "adDate": {
          "type": "string",
          "maxLength": 10
        },
        "adDesc": {
          "type": "string",
          "maxLength": 30
        },
        "adDeadline": {
          "type": "string",
          "maxLength": 10
        },
        "adWhsDeadline": {
          "type": "string",
          "maxLength": 10
        }
      }
    },
    "GetAdResult": {
      "type": "object",
      "properties": {
        "adHdrDs": {
          "$ref": "#/definitions/adHdrDsTmp"
        }
      }
    },
    "GetAllAdsByTypeResult": {
      "type": "object",
      "properties": {
        "adHdrDs_length": {
          "type": "integer",
          "format": "int32"
        },
        "adHdrDs": {
          "type": "array",
          "maxItems": 1000,
          "items": {
            "$ref": "#/definitions/adHdrDsTmp"
          }
        }
      }
    },
    "GetAllAdsResult": {
      "type": "object",
      "properties": {
        "adHdrDs_length": {
          "type": "integer",
          "format": "int32"
        },
        "adHdrDs": {
          "type": "array",
          "maxItems": 1000,
          "items": {
            "$ref": "#/definitions/adHdrDsTmp"
          }
        }
      }
    }
  },
  "paths": {
        "/adman/{adtype}/{addate}": {
      "delete": {
        "tags": [
          "adman APIs"
        ],
        "operationId": "DeleteAd",
		"summary": "Delete an Ad by supplying the ad type char(1) and ad date char(8) in the format yyyymmdd",
		"description": "Delete an Ad by supplying the ad type and ad date",
        "consumes": [
          "*/*"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "adtype",
            "in": "path",
            "required": true,
            "type": "string",
            "pattern": "\\w",
            "maxLength": 1
          },
          {
            "name": "addate",
            "in": "path",
            "required": true,
            "type": "string",
            "pattern": "\\d{4}-\\d{2}-\\d{2}",
            "maxLength": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          }
        }
      },
      "get": {
        "tags": [
          "adman APIs"
        ],
        "operationId": "GetAd",
		"summary": "Get an Ad by supplying the ad type char(1) and ad date char(8) in the format yyyymmdd",
		"description": "Get an Ad by supplying the ad type and ad date",
        "consumes": [
          "*/*"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "adtype",
            "in": "path",
            "required": true,
            "type": "string",
            "pattern": "\\w",
            "maxLength": 1
          },
          {
            "name": "addate",
            "in": "path",
            "required": true,
            "type": "string",
            "pattern": "\\d{4}-\\d{2}-\\d{2}",
            "maxLength": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/GetAdResult"
            }
          }
        }
      },
      "put": {
        "tags": [
          "adman APIs"
        ],
        "operationId": "UpdateAd",
		"summary": "Update an Ad by supplying the ad type char(1) and ad date char(8) in the format yyyymmdd",
		"description": "Update an Ad by supplying the ad type and ad date. The new values are specified in the body",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "adtype",
            "in": "path",
            "required": true,
            "type": "string",
            "pattern": "\\w",
            "maxLength": 1
          },
          {
            "name": "addate",
            "in": "path",
            "required": true,
            "type": "string",
            "pattern": "\\d{4}-\\d{2}-\\d{2}",
            "maxLength": 10
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/adHdrDsTmp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          }
        }
      }
    },
    "/{adtype}": {
      "get": {
        "tags": [
          "adman APIs"
        ],
        "operationId": "GetAllAdsByType",
		"summary": "Get all Ads by Type by dupllying s type",
		"description": "Get all Ads by Type by dupllying s type",		
        "consumes": [
          "*/*"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "adtype",
            "in": "path",
            "required": true,
            "type": "string",
            "pattern": "\\w",
            "maxLength": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/GetAllAdsByTypeResult"
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": [
          "adman APIs"
        ],
        "operationId": "GetAllAds",
		"summary": "getallads",
		"description": "Get all ads - there are no parameters",
        "consumes": [
          "*/*"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful operation",
            "schema": {
              "$ref": "#/definitions/GetAllAdsResult"
            }
          }
        }
      },
      "post": {
        "tags": [
          "adman APIs"
        ],
        "operationId": "CreateAd",
		"summary": "Createad",
		"description": "Create a new ad.  There are no parameters but the values are specified in the body",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/adHdrDsTmp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation"
          }
        }
      }
    }
  }
}

 

If anyone has any suggestions as to what the issue may be please respond.

Thanks,

Rob

 

 
 

 

3 REPLIES 3
Highlighted
Microsoft
Microsoft

Re: Customer connector: Property "" type mismatch

Hello,

 

Type value mismatch usually means that property is defined as object, but the default value is being passed as string.

 

Please check the parameters and its values which are being returned and its data type.

 

 

Highlighted
Frequent Visitor

Re: Customer connector: Property "" type mismatch

Thanks for replying @rohsh354

 

When you say "Please check the parameters and its values which are being returned and its data type." you're referring to the the Body in the Response correct?

If I call getad using postman and the same parameters 

GetAd_in_postman.png

an object is returned. 

Shouldn't the Response body in the connector be returning an object as well if both postman and powerapps are based on the same swagger file (which they are)?

 

Thanks,

rogersonra 

Highlighted
Frequent Visitor

Re: Customer connector: Property "" type mismatch

Hi @rogersonra ,

 

Just wondering if you are able to resolve this issue ? I have created a custom connector and when i "Test" , I get the error in Schema Validation saying  " Property "" type mismatch, Expected: "array", Actual: "string" ".

 

I have tried creating the custom connector by 

a. Importing a postman v1 collection

b. Exporting an API directly from APIM into Power APps environment. 

 

Both these custom connectors give the same error upon "Testing". Any help is highly appreciated. 

 

PS: Already tried adding https://powerapp.microsoft.com in the allowed origins in CORS policy of APIM

 

Thank you!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,564)