googleworkspace / php-samples

PHP samples for Google Workspace APIs
Apache License 2.0
292 stars 348 forks source link

fix: Correctly define array - not multidimensional array #136

Open jhitesma opened 2 years ago

jhitesma commented 2 years ago

I was going crazy today trying to figure out why I was getting 0 sized files on upload. Finally I noticed that I had based my work on this sample code I found on this page: https://developers.google.com/drive/api/guides/manage-uploads and the array of parameters was being doubly defined creating a multidimensional array instead of just passing parameters.

Removing either the array() or the [] around the array elements solves the problem. I'm not sure which is the preferred coding style for this project as I see several other sample files that are also using both methods of defining an array.

I also see that the 'fields' parameter is being passed - but the API docs don't show that as a paramter for the create endpoint. https://developers.google.com/drive/api/v3/reference/files/create so it appears that isn't needed either unless the api reference is out of date.

conventional-commit-lint-gcf[bot] commented 2 years ago

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot https://conventionalcommits.org/