https://github.com/preaction/yancy-plugin-openapi
Generate OpenAPI schema from a database (via Yancy::Model)
https://github.com/preaction/yancy-plugin-openapi
Last synced: 8 months ago
JSON representation
Generate OpenAPI schema from a database (via Yancy::Model)
- Host: GitHub
- URL: https://github.com/preaction/yancy-plugin-openapi
- Owner: preaction
- License: other
- Created: 2021-10-31T20:59:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-31T21:14:24.000Z (over 4 years ago)
- Last Synced: 2024-04-17T21:17:03.875Z (about 2 years ago)
- Language: Perl
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.mkdn
- Changelog: CHANGES
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Yancy::Plugin::OpenAPI - Generate an OpenAPI spec and API for a Yancy schema
# VERSION
version 0.002
# SYNOPSIS
use Mojolicious::Lite;
plugin Yancy => 'sqlite:data.db';
plugin OpenAPI => { route => '/api' };
app->start;
# DESCRIPTION
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.
# CONFIGURATION
These configuration keys can be part of the hash reference passed to the
`plugin` call.
## route
The base route path for the generated API. Can be a string or
a [Mojolicious::Routes](https://metacpan.org/pod/Mojolicious::Routes) object.
## title
The title of the API, used in the OpenAPI spec. See also ["info"](#info).
## info
The `info` section of the OpenAPI spec. A hash reference.
## host
The host key of the OpenAPI spec. Defaults to the value of
["hostname" in Sys::Hostname](https://metacpan.org/pod/Sys::Hostname#hostname).
## model
The [Yancy::Model](https://metacpan.org/pod/Yancy::Model) object to use. Defaults to
["model" in Mojolicious::Plugin::Yancy](https://metacpan.org/pod/Mojolicious::Plugin::Yancy#model).
## default\_controller
The default controller to use for generated API routes. Defaults to
`yancy`, the [Yancy::Controller::Yancy](https://metacpan.org/pod/Yancy::Controller::Yancy) controller.
# SEE ALSO
[Mojolicious::Plugin::OpenAPI](https://metacpan.org/pod/Mojolicious::Plugin::OpenAPI), [Yancy](https://metacpan.org/pod/Yancy)
# AUTHOR
Doug Bell
# COPYRIGHT AND LICENSE
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.