Change: Use the absence of "field" to refer to the root of customapi response

This commit is contained in:
Jacobo de Vera 2024-08-26 23:47:34 +01:00
parent 9b79d71ac7
commit 7b069cc51f
2 changed files with 3 additions and 3 deletions

View File

@ -57,8 +57,8 @@ widget:
- field: key - field: key
label: Number of things in array label: Number of things in array
format: size format: size
- field: . # This will take the root of the API response, e.g. when APIs return an array # This (no field) will take the root of the API response, e.g. when APIs return an array:
label: Number of items - label: Number of items
format: size format: size
``` ```

View File

@ -20,7 +20,7 @@ function getValue(field, data) {
let key = ""; let key = "";
// Support APIs that return arrays or scalars directly. // Support APIs that return arrays or scalars directly.
if (field === ".") { if (typeof field === "undefined") {
return value; return value;
} }