`vim.diagnostic.open_float` handler

I’m currently doing something like this with the handlers.

-- Hover rounded borders with transparent background
local function customise_handler(handler)
  local overrides = { border = "rounded" }
  return vim.lsp.with(function(...)
    local _, winnr = handler(...)
    if winnr then
      vim.api.nvim_win_set_option(winnr, "winblend", 20)
    end
  end, overrides)
end

vim.lsp.handlers["textDocument/hover"] = customise_handler(vim.lsp.handlers.hover)
vim.lsp.handlers["textDocument/signatureHelp"] = customise_handler(vim.lsp.handlers.signature_help)

I would like to do something similar with vim.diagnostic.open_float, but cannot find a handler for this. The best I can do so far is to bind the following function in the keymap for vim.diagnostic.open_float. Just wondering if there is a better way to do this.

function ()
  local _, winnr = vim.diagnostic.open_float({ border = "rounded" })
  if winnr then
    vim.api.nvim_win_set_option(winnr, "winblend", 20)
  end
end

I think the wrapper function is the way to go, I am doing the same. The difference between LSP handlers and diagnostic functions is that LSP handlers are callback functions to messages delivered from a separate process, so it makes sense to be able to fully swap out the handler.

On the other hand vim.diagnostic.open_float is just a function that does something with data that is already in Neovim. Having a handler system would be just extra complexity with little benefit.