Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

mpolden/flask-swagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-swagger

A Flask extension for auto-generating Swagger resource listings and API declarations using inspection and docstrings.

Basic example

from flask import Flask, jsonify
import flask.ext.swagger as swagger
app = Flask(__name__)


@app.route('/api/users/<int:user_id>')
def users():
    """
    Retrieve a user by ID

    :param user_id: User ID
    :type user_id: long
    :required user_id

    :statuscode 200: User in JSON format
    :statuscode 404: No user found
    """

    # XXX: Implementation


@app.route('/docs')
def api_docs():
    resources = swagger.make_resources(app, 'http://localhost:5000/api')
    return jsonify(resources)


if __name__ == "__main__":
    app.run()

Notes

Does not support the entire Swagger specification yet. There is currently no support for models.

About

A Flask extension for auto-generating Swagger resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages