Commit 1a4fd0ae authored by David Mendez's avatar David Mendez
Browse files

Move swagger blueprint to its own package

parent 9726639d
......@@ -62,7 +62,7 @@ unit_tests:
# Reminder for David: put here all tests that should be ready until you finish and then run all
- CONFIG_FILE_PATH='./configurations/ci_unit_tests_config.yml' python -m unittest app.models.test.test_models.TestModels
- CONFIG_FILE_PATH='./configurations/ci_unit_tests_config.yml' python -m unittest app.models.test.test_expired_job_deletion.TestExpiredJobDeletion
- CONFIG_FILE_PATH='./configurations/ci_unit_tests_config.yml' python -m unittest app.namespaces.job_submission.services.test.test_job_submission.TestJobSubmitter
- CONFIG_FILE_PATH='./configurations/ci_unit_tests_config.yml' python -m unittest app.blueprints.job_submission.services.test.test_job_submission.TestJobSubmitter
# - CONFIG_FILE_PATH='./configurations/ci_unit_tests_config.yml' python -m unittest
functional_tests:
......
......@@ -6,7 +6,7 @@ from flask import Flask, Blueprint
from app.config import RUN_CONFIG
from app.config import RunEnvs
from app.db import DB
from app.blueprints.swagger_description.swagger_description_blueprint import SWAGGER_BLUEPRINT
def create_app():
......@@ -42,14 +42,7 @@ def create_app():
base_path = RUN_CONFIG.get('base_path', '')
swager_desc_blueprint = Blueprint('swagger', __name__, url_prefix=f'{base_path}/swagger')
@swager_desc_blueprint.route('/swagger.json')
def get_json():
from flask import jsonify
return jsonify({'hello': 'world'})
flask_app.register_blueprint(swager_desc_blueprint)
flask_app.register_blueprint(SWAGGER_BLUEPRINT, url_prefix=f'{base_path}/swagger')
......
"""
Blueprint in charge of sending the swagger configuration in json format.
"""
from flask import Blueprint
SWAGGER_BLUEPRINT = Blueprint('swagger', __name__)
@SWAGGER_BLUEPRINT.route('/swagger.json')
def get_json():
from flask import jsonify
return jsonify({'hello': 'world'})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment