Skip to main content

Adding swagger ui on your AWS Lambda Function using a Flask blueprint

Project description

aws_flask_lambda_swagger_ui

Version 0.1.3 includes the templates folder and uses Flask v3.0.3 and werkzeug v3.0.3

Installation

Install the package using pip:

pip install aws-flask-lambda-swagger-ui

Usage

from flask import Flask
from aws_flask_lambda_swagger_ui import get_swaggerui_blueprint

app = Flask(__name__)

SWAGGER_URL = '/aws/test/docs' 
API_URL = 'https://petstore.swagger.io/v2/swagger.json' 

swaggerui_blueprint = get_swaggerui_blueprint(
    SWAGGER_URL,  
    API_URL,
    config={  
        'app_name': "AWS Lambda application"
    }
)

app.register_blueprint(swaggerui_blueprint, url_prefix=SWAGGER_URL)

if __name__ == '__main__':
    app.run(debug=True)

When the Flask app is running, just access the swagger url:

http://localhost:5000/aws/test/docs/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_flask_lambda_swagger_ui-0.1.4.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file aws_flask_lambda_swagger_ui-0.1.4.tar.gz.

File metadata

File hashes

Hashes for aws_flask_lambda_swagger_ui-0.1.4.tar.gz
Algorithm Hash digest
SHA256 13b324081d8fac42a83ad3dc62f1a44df9f826aa9a0e42dc6b87a3832d9968a9
MD5 edddb8f08889f39589d9dbf8a148530f
BLAKE2b-256 cc03adfa95ac4059f917dd93094307624289f551dd5cee6cb351aba685ec11a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page