From 3a41d55be6b36a16955c497492192ee7fbd30a7d Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Tue, 27 Jun 2023 15:26:53 -0500 Subject: [PATCH] Fix inserting with defaults --- docs/references/api/tables_views.rst | 39 +++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/docs/references/api/tables_views.rst b/docs/references/api/tables_views.rst index fa796c813..5a8ca92e6 100644 --- a/docs/references/api/tables_views.rst +++ b/docs/references/api/tables_views.rst @@ -853,21 +853,36 @@ Having: A request: -.. code-block:: http +.. tabs:: - POST /foo?columns=id,bar,baz HTTP/1.1 - Content-Type: application/json - Prefer: return=representation + .. code-tab:: http -.. code-block:: json + POST /foo?columns=id,bar,baz HTTP/1.1 + Content-Type: application/json + Prefer: missing=default, return=representation - [ - { "bar": "val1" - } - , { "bar": "val2" - , "baz": 15 - } - ] + [ + { "bar": "val1" + } + , { "bar": "val2" + , "baz": 15 + } + ] + + .. code-tab:: bash Curl + + curl "http://localhost:3000/foo?columns=id,bar,baz" \ + -H "Content-Type: application/json" \ + -H "Prefer: missing=default, return=representation" \ + -d @- << EOF + [ + { "bar": "val1" + } + , { "bar": "val2" + , "baz": 15 + } + ] + EOF Will result in: