superfaceai / cli

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

[BUG] Regression: Notion version header is no longer in the map #317

Closed zdne closed 1 year ago

zdne commented 1 year ago

The map generated for the Notion no longer includes mandatory Notion-Version header. And as such, does not work.

Expected Behavior

I get a map with Notion-Version header, e.g.:

function ListWorkspaceUsers({input, parameters, services}){
  const url = `${services.default}/v1/users`;
const options = {
    method: 'GET',
    query: {
        start_cursor: input.start_cursor,
        page_size: input.page_size,
    },
    headers: {
        'Notion-Version': '2022-06-28',
    },
    security: 'bearer_token',
};

Current Behavior

No version header is in the map, the comlink does not work:

function ListWorkspaceUsers({input, parameters, services}){
  const url = `${services.default}/v1/users`;
const options = {
  method: 'GET',
  query: {
    start_cursor: input.start_cursor,
    page_size: input.page_size,
  },
  headers: {
    'Content-Type': 'application/json',
  },
  security: 'bearer_token',
};

Steps to Reproduce

$ superface prepare https://developers.notion.com/reference
$ superface new notion "List all users"
$ superface map ...

Your Environment

kysely commented 1 year ago

Again related to regression #319 due to wrong docs analysis.

When reproduced, I'm getting

function ListWorkspaceUsers({input, parameters, services}){
  const url = `${services.default}/v1/users`;
const options = {
  method: 'GET',
  query: {
    start_cursor: input.start_cursor,
    page_size: input.page_size,
  },
  headers: {
    'Content-Type': 'application/json',
    'Notion-Version': '2022-06-28',
  },
  security: 'bearer_token',
};

//...
zdne commented 1 year ago

I can confirm it has been fixed 🙏