?_shape=arrayfirst, closes #287

This commit is contained in:
Simon Willison 2018-05-26 17:32:15 -07:00
commit 276913b748
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
3 changed files with 19 additions and 1 deletions

View file

@ -62,6 +62,7 @@ options:
* ``?_shape=arrays`` - ``"rows"`` is the default option, shown above
* ``?_shape=objects`` - ``"rows"`` is a list of JSON key/value objects
* ``?_shape=array`` - the entire response is an array of objects
* ``?_shape=arrayfirst`` - the entire response is a flat JSON array containing just the first value from each row
* ``?_shape=object`` - the entire response is a JSON object keyed using the primary keys of the rows
``objects`` looks like this::
@ -102,6 +103,10 @@ options:
}
]
``arrayfirst`` looks like this::
[1, 2, 3]
``object`` looks like this::
{