Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin apidocs details #2371

Merged
merged 3 commits into from
Dec 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions app/api/v2/handlers/plugins_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,25 @@ def add_routes(self, app: web.Application):
router.add_get('/plugins', self.get_plugins)
router.add_get('/plugins/{name}', self.get_plugin_by_name)

@aiohttp_apispec.docs(tags=['plugins'])
@aiohttp_apispec.docs(tags=['plugins'],
summary='Retrieve all plugins',
description='Returns a list of all available plugins in the system, including directory, description, and active status.')
@aiohttp_apispec.querystring_schema(BaseGetAllQuerySchema)
@aiohttp_apispec.response_schema(PluginSchema(many=True, partial=True))
async def get_plugins(self, request: web.Request):
plugins = await self.get_all_objects(request)
return web.json_response(plugins)

@aiohttp_apispec.docs(tags=['plugins'])
@aiohttp_apispec.docs(tags=['plugins'],
summary='Retrieve plugin by name',
description='If plugin was found with a matching name, an object containing information about the plugin is returned.',
parameters=[{
'in': 'path',
'name': 'name',
'description': 'The name of the plugin',
'schema': {'type': 'string'},
'required': 'true'
}])
@aiohttp_apispec.querystring_schema(BaseGetOneQuerySchema)
@aiohttp_apispec.response_schema(PluginSchema(partial=True))
async def get_plugin_by_name(self, request: web.Request):
Expand Down