rest – Single item endpoint responses: List vs. object


So I’m currently working on building a restful API. Let’s keep it simple and say I have two endpoints, both GET:

/products
/products/{productId}

The first returns a list of all products, the second returns a particular product.

The response for the first endpoint would likely look something this:

(
   {
       "id": 1,
       "name": ...
   },
   ...
)

However, when designing the second endpoint, I was curious whether it would be better to return a singular object like this:

{
    "id": 1,
    "name": ...
}

or a list of one object like:

(
   {
       "id": 1,
       "name": ...
   }
)

In my mind, the former feels more clean and natural (I am getting a particular product, the endpoint should return that product to me), but I could also see arguments for the latter giving more flexibility (ie. the ability to return an empty list vs. returning null).

Indeed, what is generally accepted as a best practice response when the id of the product does not match any stored products? In the first case it seems like you could return null or an exception (404 I would assume), but the second case you would also have the option of returning an empty list (similar to what would happen for the first endpoint if there were no products at all).

Is there guidelines on best practices here? I’m mostly ignoring the wrapper aspect (eg. wrapping the data in another json object and putting the data itself in a property), but if that’s pertinent to this decision I’m fine with exploring it.