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
I use the config for default and have installed jq for formatting json ¿Why don´t formatting json?
If I user jq in curl it works
localok, rest=pcall(require, "rest-nvim")
ifnotokthenreturnendrest.setup {
-- Open request results in a horizontal splitresult_split_horizontal=false,
-- Keep the http file buffer above|left when split horizontal|verticalresult_split_in_place=false,
-- Skip SSL verification, useful for unknown certificatesskip_ssl_verification=false,
-- Encode URL before making requestencode_url=true,
-- Highlight request on runhighlight= {
enabled=true,
timeout=150,
},
result= {
-- toggle showing URL, HTTP info, headers at top the of result windowshow_url=true,
show_http_info=true,
show_headers=true,
-- executables or functions for formatting response body [optional]-- set them to nil if you want to disable themformatters= {
json="jq",
html=function(body)
returnvim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end,
},
},
-- Jump to request line on runjump_to_request=false,
env_file=".env",
custom_dynamic_variables= {},
yank_dry_run=true,
}
The text was updated successfully, but these errors were encountered:
You need to check the content type for your request. I had the same issue and my problem was that the content type was application/vnd.api+json from JSON API and so the I had to add a formatter for vnd:
local ok, rest = pcall(require, "rest-nvim")
if not ok then
return
end
rest.setup {
...
result = {
...
formatters = {
json = "jq",
vnd = "jq",
html = function(body)
return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end,
},
},
}
So it might be a bug in how the content type function analyzes the content type, but has the fix is to just add another formatter in the config, I think the content type matcher shouldn't be adjusted. Maybe an adjustment in the config section of the README is necessary.
I use the config for default and have installed jq for formatting json ¿Why don´t formatting json?
If I user jq in curl it works
The text was updated successfully, but these errors were encountered: