WIP a simple nvim plugin to privew oas/openapis3 or swagger spec currently serve the api-docs using swagger-ui only..
swagger-ui (docker):
docker pull swaggerapi/swagger-ui:latest
redoc-ui (docker): currently inprogress 🚧
docker pull redocly/redoc
stoplight-ui (unofficial docker): currently inprogress 🚧
docker pull skriptfabrik/elements-cli
Lazy.nvim:
Default:
{
'rusagaib/oas-preview.nvim',
},
basic config with auto-setup ✨
{
'rusagaib/oas-preview.nvim',
config = function()
require('oas-preview').setup({
api_route = "https://127.0.0.1",
port = "1111", -- up-to-you
ui = "swagger" -- "swagger", "redoc", "stoplight"
})
end,
},
Packer:
add this line on your packer config.lua just add rusagaib/oas-preview.nvim
use {'rusagaib/oas-preview.nvim'}
Plug:
add this line on your config
Plug 'rusagaib/oas-preview.nvim'
In your init.lua (Default):
currently avail ui = "swagger",
inprogress 🚧 = "redoc", "stoplight"
# with Default config (ui = swagger)
require('oas-preview').setup({})
# OR
require('oas-preview').setup({api_route="https://127.0.0.1", port="2222", ui="stoplight"})
will call another buffer split to bottom, press enter and then it will build container to run container ui-services
and serve api documentation based from swagger or openapi3 spec (.yaml or .json)
:OASPreview
will stop buffer commands & delete container services
:OASPreviewStop