added swagger test

This commit is contained in:
CHIEFSOFT\ameye
2025-02-03 20:58:02 -05:00
parent dc54afe66e
commit ffb82c1154
2 changed files with 27 additions and 1 deletions
+25
View File
@@ -1,6 +1,31 @@
from flask import Flask
from flask_swagger_ui import get_swaggerui_blueprint
app = Flask(__name__)
SWAGGER_URL = '/api/docs' # URL for exposing Swagger UI (without trailing '/')
API_URL = 'http://petstore.swagger.io/v2/swagger.json' # Our API url (can of course be a local resource)
# Call factory function to create our blueprint
swaggerui_blueprint = get_swaggerui_blueprint(
SWAGGER_URL, # Swagger UI static files will be mapped to '{SWAGGER_URL}/dist/'
API_URL,
config={ # Swagger UI config overrides
'app_name': "Test application"
},
# oauth_config={ # OAuth config. See https://github.com/swagger-api/swagger-ui#oauth2-configuration .
# 'clientId': "your-client-id",
# 'clientSecret': "your-client-secret-if-required",
# 'realm': "your-realms",
# 'appName': "your-app-name",
# 'scopeSeparator': " ",
# 'additionalQueryStringParams': {'test': "hello"}
# }
)
app.register_blueprint(swaggerui_blueprint)
@app.route('/')
def hello():
return "Hello World!"
+2 -1
View File
@@ -12,4 +12,5 @@ flasgger
sqlalchemy
flask-socketio
Flask-Mail
pycountry
pycountry
flask-swagger-ui