Skip to content

Commit 61a3c7b

Browse files
authored
docs: add note that ordering of columns is not enforced (#3999)
1 parent f7f87b4 commit 61a3c7b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/references/api/resource_representation.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,32 @@ Use the Accept request header to specify the acceptable format (or formats) for
1616
curl "http://localhost:3000/people" \
1717
-H "Accept: application/json"
1818
19+
.. note::
20+
21+
The ordering of columns in the response isn't guaranteed to align with the order specified in the ``select`` clause. For example, with resource embedding:
22+
23+
.. code-block:: bash
24+
25+
http://localhost:3000/films?select=directors(last_name,id),title
26+
27+
We may get:
28+
29+
.. code-block:: bash
30+
31+
[
32+
{
33+
"title": "title",
34+
"directors": {
35+
"id": 5,
36+
"last_name": "name"
37+
}
38+
}
39+
]
40+
41+
This is in line with the `JSON schema spec <https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model>`_:
42+
43+
*"object: An unordered set of properties mapping a string to an instance"*
44+
1945
.. _builtin_media:
2046

2147
Builtin Media Type Handlers

0 commit comments

Comments
 (0)