How do I return an array of json objects with dynamic keys, for example:

[
    "dynamic prop 1": {
          "title": "abc",
          "sku": "123"
        },
    "dynamic prop 2": {
          "title": "xyz",
          "sku": "789"
        }
]

The default formatting is:

[
        {
          "title": "abc",
          "sku": "123"
        },
        {
          "title": "xyz",
          "sku": "789"
        }
]

Related posts

Recent Viewed