microsoft / PowerPlatformConnectors

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

paconn validate command gets service error when swagger contains invalid $ref values #155

Closed joem-msft closed 2 years ago

joem-msft commented 4 years ago

Describe the bug When a swagger file (apiDefinition.swagger.json) contains invalid $ref values, they should be reported as errors by the paconn validate command.

To Reproduce

  1. cd into the following folder: certified-connectors\Pushcut
  2. run: paconn validate -d apiDefinition.swagger.json
  3. Note, the command executes and displays a couple warnings. This is the success case.
  4. Open the file: apiDefinition.swagger.json
  5. Modify the first "$ref" property by making it invalid: e.g. "$ref": "#/definitions/NotificationZZZZ"
  6. run: paconn validate -d apiDefinition.swagger.json

The last command reports a service error response like:

{
  "error": {
    "code": "InternalServerError",
    "message": "Encountered internal server error. The tracking Id is '61e92b1e-25b0-474d-8aa2-5be81dc9ea7f'."
  }
}
500 Server Error: Internal Server Error for url: https://api.powerapps.com/providers/Microsoft.PowerApps/objectIds/adce0039-9545-4253-ae21-0cb17e131cd8/validateApiSwagger?api-version=2016-11-01&enableConnectorCertificationRules=true

Expected behavior Invalid $ref values should result in this command reporting them as errors. Preferably, reporting multiple ref errors if the file contains them.

natalie-pienkowska commented 2 years ago

We are adding this to our repair item backlog. Thank you for the details for the issue @joem-msft