From e242c973d3fb8926512b7f6064e76a674d1e4f45 Mon Sep 17 00:00:00 2001 From: Mathias Eek Date: Wed, 29 Apr 2026 11:19:10 +0200 Subject: [PATCH] fix: encode empty merge_requests body as JSON object instead of array When choose_merge_request() is called without arguments, the body function returns an empty Lua table {} which vim.json.encode serializes as a JSON array []. The Go server expects a JSON object and fails with: 'cannot unmarshal array into Go value of type ListProjectMergeRequestsOptions' Using vim.empty_dict() ensures the empty table is encoded as {} instead. --- lua/gitlab/state.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/gitlab/state.lua b/lua/gitlab/state.lua index 64e5f8ab..7a570e8d 100644 --- a/lua/gitlab/state.lua +++ b/lua/gitlab/state.lua @@ -562,7 +562,7 @@ M.dependencies = { opts["not[label]"] = opts.notlabel opts.notlabel = nil end - return opts or {} + return opts or vim.empty_dict() end, }, merge_requests_by_username = {