https://github.com/preaction/alien-swaggerui
CPAN distribution of Swagger-UI JavaScript application
https://github.com/preaction/alien-swaggerui
Last synced: 4 months ago
JSON representation
CPAN distribution of Swagger-UI JavaScript application
- Host: GitHub
- URL: https://github.com/preaction/alien-swaggerui
- Owner: preaction
- License: other
- Created: 2016-11-27T02:20:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-23T01:37:24.000Z (over 6 years ago)
- Last Synced: 2025-04-09T20:43:01.636Z (about 1 year ago)
- Language: HTML
- Size: 3.27 MB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.mkdn
- Changelog: CHANGES
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Alien::SwaggerUI - Render OpenAPI spec documentation with Swagger-UI
# VERSION
version 0.002
# STATUS
# SYNOPSIS
use Alien::SwaggerUI;
my $app_dir = Alien::SwaggerUI->root_dir;
#-- Serve Swagger-UI with Mojolicious::Lite
use File::Spec::Functions qw( catfile );
use Alien::SwaggerUI;
use Mojolicious::Lite;
get '/swagger/*path' => { path => 'index.html' }, sub {
my ( $c ) = @_;
my $path = catfile( Alien::SwaggerUI->root_dir, $c->stash( 'path' ) );
my $file = Mojo::Asset::File->new( path => $path );
$c->reply->asset( $file );
};
app->start;
# DESCRIPTION
This module contains [Swagger UI](http://swagger.io/swagger-ui/). This
pure-JavaScript application renders beautiful documentation for your
application's [OpenAPI specification](https://www.openapis.org).
The application is contained in a `share/` directory. You can get the path
to this directory with the `root_dir` method.
To render your specific API documentation, pass it in with the
`?url=/path/to/spec` query parameter.
# SEE ALSO
- [Swagger UI](http://swagger.io/swagger-ui/)
- [OpenAPI specification](https://www.openapis.org)
# AUTHOR
Doug Bell
# CONTRIBUTORS
- Gaurav Rai
- Mohammad S Anwar
# COPYRIGHT AND LICENSE
This software is Copyright (c) 2016 by Doug Bell.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
