cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jek
Level: Powered On

Custom Connector OpenAPI 2.0 - Cannot Import OpenApi-file - Regex missmatch

I have trouble importing an OpenApi definition to create a custom connector in PowerApps.

 

This is the error I get.

image.png

I thought it's strange that it seems to be a regex-error, so I checked the regex with this site:

https://regexr.com/

 

There is already a missmatch on the first ":".

No match for swagger:
image.png

 

Same when converted to Json:

image.png

The Problem occurs as soon as the Text-Field is not one continuous stream of characters or one character is a ":".

 

It is of course possible, that this is just a section of the full regex and therefore it does not work for the whole file.

 

But the error does not seem to be in the swagger / openApi definition, because it works in swagger editor and was generated using swashbuckle.

 

I would be grateful for any help or insights.

 

Best Regards

Jek

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Custom Connector OpenAPI 2.0 - Cannot Import OpenApi-file - Regex missmatch

Hi @Jek ,

Could you please share more details about your Open API definition file?

Based on the error message that you mentioned, I think there is something wrong with the host property specified within your OpenAPI Definition file.

 

I have made a test on my side, and don't have the issue that you mentioned. The Data structure of my OpenAPI Definition file as below:

{
  "swagger": "2.0",
  "info": {
    "description": "The API allows to upload image files added via Add Picture control to SP Library",
    "version": "1.0.0",
    "title": "PhotoToSPDemo",
    "termsOfService": "https://prod-11.southeastasia.logic.azure.com/terms-of-service",
    "contact": {
      "name": "API Team",
      "url": "https://github.com/ancherl",
      "email": "v-xida@microsoft.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "prod-11.southeastasia.logic.azure.com",
  "basePath": "/workflows",
  "schemes": [
    "https"
  ],
  "paths": {
    "/63b63627f82c43e7ab3c035538506488/triggers/manual/paths/invoke": {
      "post": {
        "summary": "Upload photo to SP Library",
        "operationId": "UploadPhoto",
        "consumes": [
        ],
        "produces": [
           
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        },
        "parameters": [
          {
            "name": "api-version",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "2016-06-01"
          },
          {
            "name": "sp",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "/triggers/manual/run"
          },
          {
            "name": "sv",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "1.0"
          },
          {
            "name": "sig",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "nyYxv28DmDZX9MxpOcqv5ZjhLY2ecaaTYmH9koadruQ"
          },
	  {
            "name": "fileName",
            "in": "query",
            "type": "string",
            "description": "fileName of uploaded image",
            "required": true
          },
          {
            "name": "fileContent",
            "in": "formData",
            "type": "file",
            "description": "file content of uploaded image",
            "required": true
          }
        ]
      }
    }
  }
}

The standard structure of an OpenAPI Definition file as below:

https://procsi.blob.core.windows.net/docs/SentimentDemo.openapi_definition.json

 

Please check if you have provided proper values for specific arguments (e.g. host, basePath, ... etc) within your OpenAPI Definition file.

Please consider take a try to generate your OpenAPI definition file using the following tool:

http://specgen.apistudio.io/open-api/0df7ef2f-4526-4056-b211-ab9bce02d750/run-api

then register your custom connector again, check if the issue is solved.

 

More details about creating a custom connector in PowerApps, please check the following article or video:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/register-custom-api

https://www.youtube.com/watch?v=dBCS1nPsDiE

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Custom Connector OpenAPI 2.0 - Cannot Import OpenApi-file - Regex missmatch

Hi @Jek ,

Could you please share more details about your Open API definition file?

Based on the error message that you mentioned, I think there is something wrong with the host property specified within your OpenAPI Definition file.

 

I have made a test on my side, and don't have the issue that you mentioned. The Data structure of my OpenAPI Definition file as below:

{
  "swagger": "2.0",
  "info": {
    "description": "The API allows to upload image files added via Add Picture control to SP Library",
    "version": "1.0.0",
    "title": "PhotoToSPDemo",
    "termsOfService": "https://prod-11.southeastasia.logic.azure.com/terms-of-service",
    "contact": {
      "name": "API Team",
      "url": "https://github.com/ancherl",
      "email": "v-xida@microsoft.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "prod-11.southeastasia.logic.azure.com",
  "basePath": "/workflows",
  "schemes": [
    "https"
  ],
  "paths": {
    "/63b63627f82c43e7ab3c035538506488/triggers/manual/paths/invoke": {
      "post": {
        "summary": "Upload photo to SP Library",
        "operationId": "UploadPhoto",
        "consumes": [
        ],
        "produces": [
           
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          }
        },
        "parameters": [
          {
            "name": "api-version",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "2016-06-01"
          },
          {
            "name": "sp",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "/triggers/manual/run"
          },
          {
            "name": "sv",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "1.0"
          },
          {
            "name": "sig",
            "in": "query",
            "type": "string",
            "description": "",
            "required": false,
            "default": "nyYxv28DmDZX9MxpOcqv5ZjhLY2ecaaTYmH9koadruQ"
          },
	  {
            "name": "fileName",
            "in": "query",
            "type": "string",
            "description": "fileName of uploaded image",
            "required": true
          },
          {
            "name": "fileContent",
            "in": "formData",
            "type": "file",
            "description": "file content of uploaded image",
            "required": true
          }
        ]
      }
    }
  }
}

The standard structure of an OpenAPI Definition file as below:

https://procsi.blob.core.windows.net/docs/SentimentDemo.openapi_definition.json

 

Please check if you have provided proper values for specific arguments (e.g. host, basePath, ... etc) within your OpenAPI Definition file.

Please consider take a try to generate your OpenAPI definition file using the following tool:

http://specgen.apistudio.io/open-api/0df7ef2f-4526-4056-b211-ab9bce02d750/run-api

then register your custom connector again, check if the issue is solved.

 

More details about creating a custom connector in PowerApps, please check the following article or video:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/register-custom-api

https://www.youtube.com/watch?v=dBCS1nPsDiE

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Jek
Level: Powered On

Re: Custom Connector OpenAPI 2.0 - Cannot Import OpenApi-file - Regex missmatch

Im sorry it took me so long to respond.

 

You are right, the host was in fact the problem. 

 

 

Thank you very much.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 452 members 6,655 guests
Please welcome our newest community members: