JSON with random number of values

I created a website with a Json with 0 result or 1, 2 or 3 value. I found a solution if I have 1 value, but how can I do if 2 or 3 different values like that :


or sometime just one or zero :


When I use this sensor, HA found just one of two :

  - platform: rest
    resource: https://xxx.com/ha.php
    name: website_json
    scan_interval: 30
      - price1
      - price2
    value_template: '{{ value_json.name }}'

Thanks a lot for your help

Consider that you are working with a list and not just a map.
See a code example in another project I made: