Mojolicious::Plugin::SwaggerUI - Swagger UI plugin for Mojolicious
# Mojolicious Lite plugin 'SwaggerUI' => { route => app->routes()->any('/swagger'), url => '/swagger.json', }; # Mojolicious Full $app->plugin( SwaggerUI => { route => $app->routes()->any('api'), url => "/api/v1", title => "Mojolicious App", favicon => "/images/favicon.png" } );
The plugin allows you to run the Swagger UI component inside your Mojolicious application.
plugin 'SwaggerUI' => { route => app()->routes()->any('/swagger') };
Route for the swagger-ui component. It defaults to a any route on /swagger-ui
/swagger-ui
plugin 'SwaggerUI' => { url => '/swagger.json' };
Url for the JSON Swagger specification. It defaults to /v1.
/v1
NOTE: Mojolicious::Plugin::OpenAPI can expose the JSON Swagger spec under the base path route. You can just point the path in her and it will automatically work.
plugin 'SwaggerUI' => { title => 'Project Title' };
The HTML title that you want to show on swagger-ui page. Deafult to 'Swagger UI'
plugin 'SwaggerUI' => { favicon => '/images/favicon.png' };
Favicon which you want to associate with swagger-ui page.
It will be served automatically from a 'public' directory if it exists. In case of non existence mojolicious default favicon will be displayed.
Tudor Marghidanu tudor@marghidanu.com
tudor@marghidanu.com
Gaurav Rai gauravrai7860@gmail.com
gauravrai7860@gmail.com
Copyright (C) 2019, Tudor Marghidanu.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
To install Mojolicious::Plugin::SwaggerUI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::SwaggerUI
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::SwaggerUI
For more information on module installation, please visit the detailed CPAN module installation guide.