Never assume API uses your naming conventions

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the dependencies category.

Last Updated: 2024-04-25

I tried uploading a file to s3 from Ruby with the AWS library. I ran:

obj.upload_file(file, {acl: 'public_read'}

It failed. What it actually needed instead was 'public-read', the hyphenated format being one that does not exist in Ruby land (but does in Amazon land).

I should have looked it up instead of assuming - e.g. with command line convenient docs

 yri Aws::S3::Object#upload_file

Lesson

Do not assume an API uses your naming, hyphenation, case conventions, etc.