|
OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
| def | __init__ (self, app=None, document_options=True) |
| def | init_app (self, app) |
| def | add_swagger_routes (self) |
| def | swagger_json (self) |
| def | swagger_ui (self) |
| def | register_existing_resources (self) |
| def | register (self, target, endpoint=None, blueprint=None, resource_class_args=None, resource_class_kwargs=None) |
Data Fields | |
| app | |
| view_converter | |
| resource_converter | |
| spec | |
| document_options | |
Flask-apispec extension.
Usage:
.. code-block:: python
app = Flask(__name__)
app.config.update({
'APISPEC_SPEC': APISpec(
title='pets',
version='v1',
openapi_version='2.0',
plugins=[MarshmallowPlugin()],
),
'APISPEC_SWAGGER_URL': '/swagger/',
})
docs = FlaskApiSpec(app)
@app.route('/pet/<pet_id>')
def get_pet(pet_id):
return Pet.query.filter(Pet.id == pet_id).one()
docs.register(get_pet)
:param Flask app: App associated with API documentation
:param APISpec spec: apispec specification associated with API documentation
:param bool document_options: Whether or not to include
OPTIONS requests in the specification
| def __init__ | ( | self, | |
app = None, |
|||
document_options = True |
|||
| ) |
| def add_swagger_routes | ( | self | ) |
| def init_app | ( | self, | |
| app | |||
| ) |
| def register | ( | self, | |
| target, | |||
endpoint = None, |
|||
blueprint = None, |
|||
resource_class_args = None, |
|||
resource_class_kwargs = None |
|||
| ) |
Register a view.
:param target: view function or view class.
:param endpoint: (optional) endpoint name.
:param blueprint: (optional) blueprint name.
:param tuple resource_class_args: (optional) args to be forwarded to the
view class constructor.
:param dict resource_class_kwargs: (optional) kwargs to be forwarded to
the view class constructor.
| def register_existing_resources | ( | self | ) |
| def swagger_json | ( | self | ) |
| def swagger_ui | ( | self | ) |
| app |
| document_options |
| resource_converter |
| spec |
| view_converter |