Quick Start

This page is best point to getting started.

You can find out source code from https://github.com/hardtack/flask-swag


There are two ways to configure your app for Flask-Swag, just like other flask extensions.

First, you can configure on init

from flask.ext.swag import Swag

swag = Swag(app)

Or you can configure later

from .exts import swag



By default, you may find out Swagger-UI on /swagger/ui/ provided by blueprint.


You can customize Swagger-UI by configuring 'SWAG_UI_ROOT'


You can add additional field to operations by marking.

@swag.mark.summary("Get list of users.")
@swag.mark.query('page', int)
@swag.mark.response(200, "List of users.", user_list_schema)
def user_index():
    Get list of users.

    The result will be paginated, default page is 1.

or for complex operations, you can set operation’s fields directly

    'description': "Read user's info.",
    'responses': {
        200: {
            'description': "User object."
            'schema': {
                'properties': {
                    'name': {'type': 'string'}
def user_read(user_id):

You can mark parameters from formencode.

from .formencode_schemas import UserCreateSchema

@app.route('/users/', methods=['POST'])
def user_create():

And you can set resposne’s schema from marshmallow.

from .marshmallow_schemas import UserSchema

@swag.response(200, "User's info", UserSchema())
def user_read(user_id):