json returning list issues are the bane of my existence. One thing to try: see if the API has a “single result” flag or param. Some APIs let you specify whether you want a list or a single object.
If not, maybe the API is just poorly designed. In that case, yeah, grabbing the first item is a workaround, but it’s not ideal. You could also write a wrapper function to handle the json returning list case and return the first item if the array length is 1.
If not, maybe the API is just poorly designed. In that case, yeah, grabbing the first item is a workaround, but it’s not ideal. You could also write a wrapper function to handle the json returning list case and return the first item if the array length is 1.
