Yancy::Plugin::OpenAPI - Generate an OpenAPI spec and API for a Yancy schema
version 0.002
use Mojolicious::Lite; plugin Yancy => 'sqlite:data.db'; plugin OpenAPI => { route => '/api' }; app->start;
This plugin generates an OpenAPI specification from your database schema. The generated spec has endpoints to create, read, update, delete, and search for items in your database.
These configuration keys can be part of the hash reference passed to the plugin call.
plugin
The base route path for the generated API. Can be a string or a Mojolicious::Routes object.
The title of the API, used in the OpenAPI spec. See also "info".
The info section of the OpenAPI spec. A hash reference.
info
The host key of the OpenAPI spec. Defaults to the value of "hostname" in Sys::Hostname.
The Yancy::Model object to use. Defaults to "model" in Mojolicious::Plugin::Yancy.
The default controller to use for generated API routes. Defaults to yancy, the Yancy::Controller::Yancy controller.
yancy
Mojolicious::Plugin::OpenAPI, Yancy
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2021 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Yancy::Plugin::OpenAPI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yancy::Plugin::OpenAPI
CPAN shell
perl -MCPAN -e shell install Yancy::Plugin::OpenAPI
For more information on module installation, please visit the detailed CPAN module installation guide.