Json_attributes_path - Selecting final value

Hello,

I am struggling to get json_attributes_path working properly on a rest sensor for selecting the most recent update.

My json_attributes_path value is as follows:

json_attributes_path: “$[-1]”

I have manually selected any object in this array, such as the following, and the attributes are loaded as expected:
json_attributes_path: “$[0]”

In the logging, I can see that it is selecting the entire array, rather than the last element.

Here is a shortened version of that logging:

[36m2025-01-26 17:25:17.925 DEBUG (MainThread) [homeassistant.components.rest.data] Data fetched from resource: [{"id":1,"product_id":1,"amount":4,"best_before_date":"2024-10-15","purchased_date":"2024-09-12","used_date":null,"spoiled":0,"stock_id":"66e35f0284b14","transaction_type":"purchase","price":0.69,"undone":0,"undone_timestamp":null,"opened_date":null,"location_id":2,"recipe_id":null,"correlation_id":null,"transaction_id":"66e35f0284b12","stock_row_id":null,"shopping_location_id":null,"user_id":1,"row_created_timestamp":"2024-09-12 21:37:06","note":null},{"id":67,"product_id":10,"amount":-1,"best_before_date":"2999-12-31","purchased_date":"2024-09-13","used_date":"2025-01-26","spoiled":0,"stock_id":"66e4b2e70d9aa","transaction_type":"consume","price":3.39,"undone":0,"undone_timestamp":null,"opened_date":null,"location_id":3,"recipe_id":null,"correlation_id":null,"transaction_id":"6796c11e40ebd","stock_row_id":null,"shopping_location_id":null,"user_id":1,"row_created_timestamp":"2025-01-26 23:11:26","note":null}]
[33m2025-01-26 17:25:17.925 WARNING (MainThread) [homeassistant.components.rest.util] JSON result was not a dictionary or list with 0th element a dictionary

This seems to be valid JSONPath according to RFC 9535 and jsonpath.com, but it is not working properly in my setup.

Maybe post the data and your sensor-taml so people can see what you want?