Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade samples to v40 and use new requestBody key #77

Open
codeekage opened this issue Jun 2, 2019 · 3 comments · May be fixed by #345
Open

Upgrade samples to v40 and use new requestBody key #77

codeekage opened this issue Jun 2, 2019 · 3 comments · May be fixed by #345
Labels
enhancement New feature or request

Comments

@codeekage
Copy link

codeekage commented Jun 2, 2019

Can I make a quick contribution to improving the docs? requestBody object to replace responses like so:

Pass

const req = {
  requestBody: {
          properties: {
            title : sheetTitle
          }
        },
        auth
}
 sheet.spreadsheets.create(req, callback)

//Using Promises

const creatSheet = await  sheet.spreadsheets.create(req)

Fails

const res = {
  resource: {
          properties: {
            title : sheetTitle
          }
        },
        auth
}
 sheet.spreadsheets.create(res, callback)

// Using Promises

const creatSheet =  await sheet.spreadsheets.create(res)

Link: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create

@erickoledadevrel
Copy link

Where do you see the failing code in the documentation?

@erickoledadevrel erickoledadevrel self-assigned this Jun 3, 2019
@codeekage
Copy link
Author

Updated the issue with the link. Sorry for missing that out. 😅

@erickoledadevrel
Copy link

So using the key "responses" like you had in your original code will fail, but isn't what's shown on the page. The preferred key was recently changes to "requestBody", but it was a backwards compatible change and "resources" is still accepted.

googleapis/google-api-nodejs-client#1149

Changing this to an enhancement to upgrade to v40 of the library and update our key to "requestBody".

@erickoledadevrel erickoledadevrel added the enhancement New feature or request label Jun 3, 2019
@erickoledadevrel erickoledadevrel changed the title Improving QuickStart Docs for spreadsheet create fn (Node.js) Upgrade samples to v40 and use new requestBody key Jun 3, 2019
@erickoledadevrel erickoledadevrel removed their assignment Jun 3, 2019
faheel added a commit to faheel/node-samples that referenced this issue Jan 28, 2023
@faheel faheel linked a pull request Jan 28, 2023 that will close this issue
faheel added a commit to faheel/node-samples that referenced this issue Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants