Add initial swagger.json endpoint for API

probably this needs more, but good enough to test with
This commit is contained in:
Lance Edgar 2023-05-16 23:10:54 -05:00
parent 26a6a4d991
commit c18367739f
3 changed files with 26 additions and 0 deletions

View file

@ -275,6 +275,11 @@ class CommonView(View):
config.add_tailbone_permission('common', 'common.edit_help',
"Edit help info for *any* page")
# API swagger
if rattail_config.getbool('tailbone', 'expose_api_swagger'):
config.add_tailbone_permission('common', 'common.api_swagger',
"Explore the API with Swagger tools")
# home
config.add_route('home', '/')
config.add_view(cls, attr='home', route_name='home', renderer='/home.mako')