vim-yapi
integrates the yapi CLI based API Client into vim.
Start with a yapi.yml
file in the current buffer:
---
# Project Settings
root: http://localhost:3000
session: my_project
headers:
Content-Type: application/json
Accept: application/json
print_headers: true
# Routes
users.index:
path: /users
params:
page: 2
per: 100
users.show:
path: /users/1
users.create:
path: /users
method: POST
body: |
{
"name": "Test User",
"email": "[email protected]",
}
Place your cursor anywhere inside a named request
users.index:
path: /users
params: โ <-- Cursor
page: 2
per: 100
and run :YAPIFetch
.
Use your preferred package management tool, for vim-plug:
Plug 'dbridges/vim-yapi'
vim-yapi
requires yapi to be installed.
You might consider mapping :YAPIFetch
in your .vimrc
:
autocmd BufRead,BufNewFile *yapi.yml nnoremap <buffer> <Leader>r :YAPIFetch<CR>