X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2app%2Fentrypoints%2Fflask_application.py;h=0f9d3f4cc079ba62a2d68370019283dc99ad0f68;hb=94b4519e5482219b60342c73157faf339fac071b;hp=f74dca2773f5da4eef25a3d519166a7ed1141941;hpb=5601b5899b0fd15748ae0474de9f5f6dda72864c;p=pti%2Fo2.git diff --git a/o2app/entrypoints/flask_application.py b/o2app/entrypoints/flask_application.py index f74dca2..0f9d3f4 100644 --- a/o2app/entrypoints/flask_application.py +++ b/o2app/entrypoints/flask_application.py @@ -18,7 +18,7 @@ from flask_restx import Api from o2app import bootstrap from o2ims.views import configure_namespace as ims_route_configure_namespace -from o2dms.api import configure_namespace as dms_route_configure_namespace +from o2common.views.route_exception import configure_exception from o2ims.adapter.clients.alarm_dict_client import load_alarm_definition from o2common.authmw import authmiddleware @@ -40,6 +40,8 @@ def _get_k8s_url(): raise Exception('Get k8s token review url failed') +FLASK_API_VERSION = '1.0.0' + if auth: # perform service account identity&privilege check. _get_k8s_url() @@ -48,13 +50,16 @@ if auth: app.wsgi_app = authmiddleware.authmiddleware(app.wsgi_app) app.config.SWAGGER_UI_DOC_EXPANSION = 'list' -api = Api(app, version='1.0.0', +# app.config['RESTX_MASK_HEADER'] = 'fields' +app.config['RESTX_MASK_SWAGGER'] = False +app.config['ERROR_INCLUDE_MESSAGE'] = False +api = Api(app, version=FLASK_API_VERSION, title='INF O2 Services API', description='Swagger OpenAPI document for the INF O2 Services', ) bus = bootstrap.bootstrap() +configure_exception(api) ims_route_configure_namespace(api) -dms_route_configure_namespace(api) load_alarm_definition(bus.uow)