From fa70c2d6127fce2b51ecb4e6f3b8517f569f8945 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 17 Dec 2024 11:47:30 +0200 Subject: [PATCH 1/4] Change type in openapi.yaml to string --- .../service_apis/controllers/default_controller.py | 7 ++----- .../service_apis/openapi/openapi.yaml | 9 ++++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index 05c6d6a..374ba0d 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -55,18 +55,15 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t :rtype: Union[DiscoveredAPIs, Tuple[DiscoveredAPIs, int], Tuple[DiscoveredAPIs, int, Dict[str, str]] """ + if request.is_json: comm_type = CommunicationType.from_dict(request.get_json()()) # noqa: E501 - if request.is_json: protocol = Protocol.from_dict(request.get_json()()) # noqa: E501 - if request.is_json: data_format = DataFormat.from_dict(request.get_json()()) # noqa: E501 - if request.is_json: preferred_aef_loc = AefLocation.from_dict(request.get_json()()) # noqa: E501 - if request.is_json: ue_ip_addr = IpAddrInfo.from_dict(request.get_json()()) # noqa: E501 - if request.is_json: service_kpis = ServiceKpis.from_dict(request.get_json()()) # noqa: E501 + current_app.logger.info("Discovering service apis") query_params = {"api_name": api_name, "api_version": api_version, "comm_type": comm_type, diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml index f1304c2..e70bcab 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml @@ -52,7 +52,8 @@ paths: name: comm-type required: false schema: - $ref: '#/components/schemas/CommunicationType' + type: string +# $ref: '#/components/schemas/CommunicationType' style: form - description: Protocol used by the API. explode: true @@ -60,7 +61,8 @@ paths: name: protocol required: false schema: - $ref: '#/components/schemas/Protocol' + type: string +# $ref: '#/components/schemas/Protocol' style: form - description: AEF identifer. explode: true @@ -77,7 +79,8 @@ paths: name: data-format required: false schema: - $ref: '#/components/schemas/DataFormat' + type: string +# $ref: '#/components/schemas/DataFormat' style: form - description: The service API category to which the service API belongs to. explode: true -- GitLab From 4fa747a742f3c9b6285175441145991bd8f7b0ec Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 18 Dec 2024 10:38:41 +0200 Subject: [PATCH 2/4] add type string to the components directly and not to the discover api schema --- .../service_apis/openapi/openapi.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml index e70bcab..c0c2608 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/openapi/openapi.yaml @@ -52,8 +52,7 @@ paths: name: comm-type required: false schema: - type: string -# $ref: '#/components/schemas/CommunicationType' + $ref: '#/components/schemas/CommunicationType' style: form - description: Protocol used by the API. explode: true @@ -61,8 +60,7 @@ paths: name: protocol required: false schema: - type: string -# $ref: '#/components/schemas/Protocol' + $ref: '#/components/schemas/Protocol' style: form - description: AEF identifer. explode: true @@ -79,8 +77,7 @@ paths: name: data-format required: false schema: - type: string -# $ref: '#/components/schemas/DataFormat' + $ref: '#/components/schemas/DataFormat' style: form - description: The service API category to which the service API belongs to. explode: true @@ -1186,6 +1183,7 @@ components: type: string type: object CommunicationType: + type: string anyOf: - enum: - REQUEST_RESPONSE @@ -1200,6 +1198,7 @@ components: \ type subscribe-notify.\n" title: CommunicationType Protocol: + type: string anyOf: - enum: - HTTP_1_1 @@ -1217,6 +1216,7 @@ components: \ Indicates that the protocol is Websocket.\n" title: Protocol DataFormat: + type: string anyOf: - enum: - JSON -- GitLab From 946fbcf39b44c5a485397f88efd6bf04ebc130aa Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 18 Dec 2024 10:41:59 +0200 Subject: [PATCH 3/4] Remove request.is_json check in all_service_apis_get --- .../service_apis/controllers/default_controller.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index 374ba0d..0b87ef6 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -56,13 +56,12 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t :rtype: Union[DiscoveredAPIs, Tuple[DiscoveredAPIs, int], Tuple[DiscoveredAPIs, int, Dict[str, str]] """ - if request.is_json: - comm_type = CommunicationType.from_dict(request.get_json()()) # noqa: E501 - protocol = Protocol.from_dict(request.get_json()()) # noqa: E501 - data_format = DataFormat.from_dict(request.get_json()()) # noqa: E501 - preferred_aef_loc = AefLocation.from_dict(request.get_json()()) # noqa: E501 - ue_ip_addr = IpAddrInfo.from_dict(request.get_json()()) # noqa: E501 - service_kpis = ServiceKpis.from_dict(request.get_json()()) # noqa: E501 + comm_type = CommunicationType.from_dict(request.get_json()()) # noqa: E501 + protocol = Protocol.from_dict(request.get_json()()) # noqa: E501 + data_format = DataFormat.from_dict(request.get_json()()) # noqa: E501 + preferred_aef_loc = AefLocation.from_dict(request.get_json()()) # noqa: E501 + ue_ip_addr = IpAddrInfo.from_dict(request.get_json()()) # noqa: E501 + service_kpis = ServiceKpis.from_dict(request.get_json()()) # noqa: E501 current_app.logger.info("Discovering service apis") -- GitLab From 761d437d21e5fb9f297a8d098b52a82e91cf1b22 Mon Sep 17 00:00:00 2001 From: Stavros-Anastasios Charismiadis Date: Wed, 18 Dec 2024 14:54:03 +0200 Subject: [PATCH 4/4] Ski request.is_json part --- .../service_apis/controllers/default_controller.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py index 0b87ef6..e6b41b0 100644 --- a/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Discover_Service_API/service_apis/controllers/default_controller.py @@ -56,13 +56,6 @@ def all_service_apis_get(api_invoker_id, api_name=None, api_version=None, comm_t :rtype: Union[DiscoveredAPIs, Tuple[DiscoveredAPIs, int], Tuple[DiscoveredAPIs, int, Dict[str, str]] """ - comm_type = CommunicationType.from_dict(request.get_json()()) # noqa: E501 - protocol = Protocol.from_dict(request.get_json()()) # noqa: E501 - data_format = DataFormat.from_dict(request.get_json()()) # noqa: E501 - preferred_aef_loc = AefLocation.from_dict(request.get_json()()) # noqa: E501 - ue_ip_addr = IpAddrInfo.from_dict(request.get_json()()) # noqa: E501 - service_kpis = ServiceKpis.from_dict(request.get_json()()) # noqa: E501 - current_app.logger.info("Discovering service apis") query_params = {"api_name": api_name, "api_version": api_version, "comm_type": comm_type, -- GitLab