superfaceai / cli

Let AI connect the APIs for you
https://superface.ai
MIT License
22 stars 4 forks source link

[BUG] Hallucinated error handling upon significant profile change #339

Open zdne opened 1 year ago

zdne commented 1 year ago

Following the pipedrive tutorial everything works ok.

When I simplify the profile and change it to

name = "contacts-management/get-organizations"
version = "0.0.0"

"Retrieve a page of companies with in a CRM, Returns all organizations in the system."
usecase ListCompanies safe  {
  input {
  }
  result {
    companies[
      {
        "Name of the company"
        name! string!
      }
    ]
  }
}

and run the

sf map pipedrive organizations-management/get-organizations

I get map with incorrect error handling (with original profile it was correct):

Screenshot 2023-07-20 at 10 22 22

This incorrect handling is causing the error:

errorResult: { code: 200, message: 'HTTP call failed' }

When I correct the handling to (red version) then it works ok.

Expected Behavior

The error handling in map is correct, as it was in the map generated from the original profile.

Current Behavior

The error handling is not correct and causes false errors.

Steps to Reproduce

  1. follow the pipedrive tutorial
  2. then, replace the profile with the one above

Your Environment

julpat commented 1 year ago

I can confirm it. Even without any profile modification. Condition in the map if (response.status !== 200) { vs response returning 201 when successful.

Prompt: "create organization" Docs used: https://developers.pipedrive.com/docs/api/v1/openapi.yaml (I have followed the Pipedrive example in our docs)