From 0d4e9e0e0931e60065de9172bebeff7f796ae4a4 Mon Sep 17 00:00:00 2001 From: harshsoni2024 <64592571+harshsoni2024@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:10:15 +0530 Subject: [PATCH] MINOR: REST minor fixes (#20907) --- .../ingestion/source/api/rest/metadata.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/api/rest/metadata.py b/ingestion/src/metadata/ingestion/source/api/rest/metadata.py index 52048f47dde..4cae45442e5 100644 --- a/ingestion/src/metadata/ingestion/source/api/rest/metadata.py +++ b/ingestion/src/metadata/ingestion/source/api/rest/metadata.py @@ -197,8 +197,9 @@ class RestSource(ApiServiceSource): ) -> Optional[RESTEndpoint]: try: endpoint = RESTEndpoint(**info) - endpoint.name = f"{path}/{method_type}" - endpoint.display_name = f"{path}" + path_clean_name = clean_uri(path) + endpoint.name = f"{path_clean_name}/{method_type}" + endpoint.display_name = f"{path_clean_name}" endpoint.url = self._generate_endpoint_url(collection, endpoint) return endpoint except Exception as err: @@ -279,6 +280,18 @@ class RestSource(ApiServiceSource): .get("schema", {}) .get("$ref", {}) ) + if not schema_ref: + logger.debug("Trying to parse response schema from schema property") + schema_ref = ( + info.get("responses", {}) + .get("200", {}) + .get("content", {}) + .get("application/json", {}) + .get("schema", {}) + .get("properties", {}) + .get("data", {}) + .get("$ref") + ) if not schema_ref: logger.debug("No response schema found for the endpoint") return None