microsoft / PowerPlatformConnectors

This is a repository for Microsoft Power Automate, Power Apps, and Azure Logic Apps connectors
https://aka.ms/connectors
MIT License
975 stars 1.26k forks source link

[BUG] KeyError: 'description' #2877

Open Craig-Humphrey opened 1 year ago

Craig-Humphrey commented 1 year ago

Type of Connector

Custom Connector

Name of Connector

MyPractice API v1

Describe the bug

I'm trying to push the host name into the connection properties (would really like to add HTTP/HTTPS, gateway yes/no and baseURL as well, but have to start somewhere).

I've been following the steps at https://philcole.org/post/environment-specific-custom-connector-endpoints/ as best I can, but when I attempt the paconn update, I get the following error:

Connector selected: MyPractice API v1 - Craig Humphrey
'description'
Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\knack\cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\knack\invocation.py", line 188, in execute
    cmd_result = parsed_args.func(params)
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\knack\commands.py", line 131, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\knack\commands.py", line 238, in _command_handler
    result = op(client, **command_args) if client else op(**command_args)
                                                       ^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\paconn\commands\update.py", line 48, in update
    connector_id = upsert(
                   ^^^^^^^
  File "C:\Python311\Lib\site-packages\paconn\operations\upsert.py", line 127, in upsert
    properties[_DESCRIPTION] = openapi_definition[_INFO][_DESCRIPTION]
                               ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'description'

Is this a security bug?

No, this is not a security bug

What is the severity of this bug?

Severity 1 - Connector is broken or there's a very serious issue

To Reproduce

I added the following connectionParameters to my apiProperties.json file: "endpointUrl": { "type": "string", "uiDefinition": { "constraints": { "required": "true" }, "description": "API host name (Exampled: mypracticeapi.company.com)", "displayName": "API host name", "tooltip": "API host name (Exampled: mypracticeapi.company.com)" } }

The rest is the same as in the tutorial (policy template).

Expected behavior

I was hoping it would just work :)

Environment summary

Install Method: pip

CLI version (paconn --version) paconn --version 0.0.20

Python (Windows) 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)]

OS version Windows 11, 22H2 (22621.2134)

Shell Type PowerShell v7

Additional context

This is my first Custom Connector and I need to parametrise the host so that I can have a generic Custom Connector name, so that it doesn't fail when I try to import my PowerApp/Automate solution into a client's tenant. Thanks!

Craig-Humphrey commented 1 year ago

nudge