Api
class¶
There is not much to say about Api
except that it has an optional prefix
and decorators
. Use:
api.add_resource(YourResource)
To add a resource to the API. You can only add a single resource with a given name.
-
class
flask_potion.
Api
(app=None, decorators=None, prefix=None, title=None, description=None, default_manager=None)¶ This is the Potion extension.
You need to register
Api
with aFlask
application either upon initializingApi
or later usinginit_app()
.Parameters: - app – a
Flask
instance - decorators (list) – an optional list of decorator functions
- prefix – an optional API prefix. Must start with “/”
- title (str) – an optional title for the schema
- description (str) – an optional description for the schema
- default_manager (Manager) – an optional manager to use as default. If SQLAlchemy is installed, will use
contrib.alchemy.SQLAlchemyManager
- app – a