You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add Paths Object for POST requests on RPC endpoints (#51)
* Adds POST paths to the existing "/rpc/<function_name>" endpoints for valid functions
* Adds Schema Objects for function parameters to be used in the request body
* Adds common and specific Media Types to the Request Body Object (includes single unnamed argument functions)
* Adds "rowFilter"s for functions that return <table>, <composite type> or have TABLE or INOUT/OUT arguments
requestBody := case when argument_input_qty >0 then oas_build_reference_to_request_bodies('rpc.'|| function_full_name) end,
198
+
parameters :=
199
+
-- TODO: The row filters for functions returning TABLE, OUT, INOUT and composite types should also work for the GET path.
200
+
-- Right now they're not included in GET, because the argument names (in rpcParams) could clash with the name of the return type columns (in rowFilter).
select coalesce(jsonb_agg(oas_build_reference_to_parameters(format('rowFilter.%1$s.%2$s', table_full_name, column_name))),'[]') as return_composite_param_ref
251
+
from (
252
+
selectc.table_full_name, c.column_name
253
+
from postgrest_get_all_tables_and_composite_types() c
254
+
wheref.return_type_composite_relid=c.table_oid
255
+
) _
256
+
) comp on true
197
257
) _
198
-
group by function_name, function_full_name, function_description, return_type_name, return_type_is_set, return_type_is_table, return_type_is_out, return_type_composite_relid
258
+
group by function_name, function_full_name, function_description, return_type_name, return_type_is_set, return_type_is_table, return_type_is_out, return_type_composite_relid, argument_input_qty, return_composite_param_ref
format_type(t.oid, NULL::integer) AS return_type_name,
251
255
format_type(t_arr.oid, NULL::integer) AS return_type_item_name,
252
256
p.proretsetAS return_type_is_set,
@@ -290,7 +294,7 @@ $$
290
294
WHEREx.argument_input_qty>0
291
295
ANDx.argument_name=''
292
296
AND (x.argument_is_inORx.argument_is_inoutORx.argument_is_variadic)
293
-
AND NOT (x.argument_input_qty=1ANDx.argument_reg_typeIN ('bytea'::regtype, 'json'::regtype, 'jsonb'::regtype, 'text'::regtype, 'xml'::regtype))
297
+
AND NOT (x.argument_input_qty=1ANDx.function_input_argument_types[0]IN ('bytea'::regtype, 'json'::regtype, 'jsonb'::regtype, 'text'::regtype, 'xml'::regtype))
0 commit comments