Skip to content

WIP a simple nvim/neovim plugin to preview oas/openapi3 or swagger spec.

License

Notifications You must be signed in to change notification settings

rusagaib/oas-preview.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

oas-preview.nvim

WIP a simple nvim plugin to privew oas/openapis3 or swagger spec currently serve the api-docs using swagger-ui only..

image

Prerequisite ✨


Installing the UI:

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

Install Plugin 🚀


Lazy.nvim:

Default:

{
    'rusagaib/oas-preview.nvim',
},

basic config with auto-setup ✨

{
    'rusagaib/oas-preview.nvim',
    config = function()
        require('oas-preview').setup({
            api_route = "http://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'

Apply/setup oas-preview plugin 🙇


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="http://127.0.0.1", port="2222", ui="stoplight"})

Run 🔥


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

Stop opts 🚩


will stop buffer commands & delete container services

:OASPreviewStop

Any contributions are welcome 🍺

Releases

No releases published

Packages

No packages published

Languages