jcberquist / aws-cfml

Lucee/ColdFusion library for interacting with AWS API's
MIT License
72 stars 53 forks source link

listBuckets returns struct or array #79

Open chapmandu opened 1 year ago

chapmandu commented 1 year ago

This is more a question than an issue, depending on the answer..

Invoking s3.listBuckets(), if there is one bucket the data.Buckets value is a struct, if there is more than one, it's an array.

Is this the expected/desired behaviour?

Thanks!

jcberquist commented 1 year ago

Thanks for pointing that out. It should definitely always return an array. The code currently in use for converting XML data doesn't make that distinction, so you can see how in the other list methods check to ensure that what is returned is an array, for example: https://github.com/jcberquist/aws-cfml/blob/master/services/s3.cfc#L67-L72