I would have expected to be able to pass arrays, give we're working with Node. Plus the documentation says those parameters (chainCodes, amenities and ratings) are arrays of strings.
Actual Behavior:
When passing an array to any of those parameters, the response is 400, Invalid Format. This seems to be caused by how array get represented in the GET request:
Description
The
amadeus.referenceData.locations.hotels.byCity.get
endpoint seems to not support passing arrays as parametersSteps to Reproduce
Expected Behavior:
I would have expected to be able to pass arrays, give we're working with Node. Plus the documentation says those parameters (chainCodes, amenities and ratings) are arrays of strings.
Actual Behavior:
When passing an array to any of those parameters, the response is 400, Invalid Format. This seems to be caused by how array get represented in the GET request:
'v1/reference-data/locations/hotels/by-city?cityCode=MIL&radius=5&radiusUnit=KM&hotelSource=ALL&amenities%5B0%5D=FITNESS_CENTER&ratings%5B0%5D=4&ratings%5B1%5D=5'
In order for it to work, I need to convert them to comma separated values. The documentation for ratings gave a hint on that:
chainCodes.join(",");
Maybe this is expected behavior, but in that case perhaps it should be documented and/or added in the code example.
Stable Behavior?
100% of the times.
Versions
Running Node version 20.17.0 on MacOS Sonoma 14.6.1
Checklist
Please make sure you checked the following: