ApiSpec plugin¶
Plugin ApiSpecPlugin adds the following features:
Auto-generated documentation for JSON API, ResourceList and ResourceDetail resource managers.
Support for auto-generating documentation of RPC API made with EventPlugin
Tag-based API grouping in swagger.
Plugin is based on apispec using RestfulPlugin.
How to use¶
To start, do the following:
Add a plugin instance at application initialization.
Plugin supports the following parameters:
app: Flask- application instancedecorators: Tuple = None- tuple with decorators which will get attached to swaggertags: Dict[str, str] = None- list of tags with descriptions; routers can be grouped by these tags.
When declaring routers, you can specify a tag
tag: str. Tag should be listed at plugin initialization, or you’ll get an error.When adding a RPC API view made with EventPlugin, describe the API using yaml in the view beginning API description structure.
Plugin usage example is available in EventPlugin description.