From fe794153ed3f267bfba13b78fde67b999fe7e600 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 13 Jul 2026 20:01:55 +0200 Subject: feat(docs): mark optional API parameters --- src/gen/gen_api_dispatch.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/gen/gen_api_dispatch.lua') diff --git a/src/gen/gen_api_dispatch.lua b/src/gen/gen_api_dispatch.lua index 990f6f0a01..731a9a0097 100644 --- a/src/gen/gen_api_dispatch.lua +++ b/src/gen/gen_api_dispatch.lua @@ -118,12 +118,7 @@ local function add_function(fn) fn.parameters[#fn.parameters] = nil end -- `opts` (a KeyDict) and every parameter following it are optional: clients may omit them. - for k = 1, #fn.parameters do - if fn.parameters[k][2] == 'opts' and real_type(fn.parameters[k][1]):match('^KeyDict_') then - fn.opts_idx = k - break - end - end + fn.opts_idx = c_grammar.opts_index(fn.parameters) -- Omitted optional param is zero-initialized, which assumes Dict/Array. if fn.opts_idx then for k = fn.opts_idx + 1, #fn.parameters do -- cgit