Repository: safe-global/safe-config-service

Issue:
Use different namespace and endpoint name for `/safe-apps`
The endpoint `/api/v1/safe-apps` is currently under the `v1` namespace and `safe-apps` endpoint name.

To align it better with the future endpoints the following should be changed:

- the namespace changes from `v1` to `safe-apps`
- the endpoint name changes from `safe-apps` to `list`

This results in a reverse url resolution with `safe-apps:list` instead of `v1:safe-apps`


Discussion:

Resolving patch:
diff --git a/src/config/urls.py b/src/config/urls.py
--- a/src/config/urls.py
+++ b/src/config/urls.py
@@ -11,7 +11,7 @@
 )
 
 urlpatterns = [
-    path("api/v1/", include("safe_apps.urls", namespace="v1")),
+    path("api/v1/", include("safe_apps.urls", namespace="safe-apps")),
     path("api/v1/", include("chains.urls", namespace="chains")),
     path("admin/", admin.site.urls),
     path("check/", lambda request: HttpResponse("Ok"), name="check"),
diff --git a/src/safe_apps/urls.py b/src/safe_apps/urls.py
--- a/src/safe_apps/urls.py
+++ b/src/safe_apps/urls.py
@@ -5,5 +5,5 @@
 app_name = "apps"
 
 urlpatterns = [
-    path("safe-apps/", SafeAppsListView.as_view(), name="safe-apps"),
+    path("safe-apps/", SafeAppsListView.as_view(), name="list"),
 ]


Test patch:
diff --git a/src/safe_apps/tests/test_views.py b/src/safe_apps/tests/test_views.py
--- a/src/safe_apps/tests/test_views.py
+++ b/src/safe_apps/tests/test_views.py
@@ -6,7 +6,7 @@
 
 class EmptySafeAppsListViewTests(APITestCase):
     def test_empty_set(self):
-        url = reverse("v1:safe-apps")
+        url = reverse("safe-apps:list")
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -28,7 +28,7 @@ def test_json_payload_format(self):
                 "provider": None,
             }
         ]
-        url = reverse("v1:safe-apps")
+        url = reverse("safe-apps:list")
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -65,7 +65,7 @@ def test_all_safes_returned(self):
                 "provider": None,
             },
         ]
-        url = reverse("v1:safe-apps")
+        url = reverse("safe-apps:list")
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -100,7 +100,7 @@ def test_all_apps_returned_on_empty_chain_id_value(self):
                 "provider": None,
             },
         ]
-        url = reverse("v1:safe-apps") + f'{"?chainId="}'
+        url = reverse("safe-apps:list") + f'{"?chainId="}'
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -129,7 +129,7 @@ def test_apps_returned_on_filtered_chain_id(self):
                 "provider": None,
             },
         ]
-        url = reverse("v1:safe-apps") + f'{"?chainId=1"}'
+        url = reverse("safe-apps:list") + f'{"?chainId=1"}'
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -139,7 +139,7 @@ def test_apps_returned_on_filtered_chain_id(self):
     def test_apps_returned_on_unexisting_chain(self):
         SafeAppFactory.create_batch(3, chain_ids=[12])
         json_response = []
-        url = reverse("v1:safe-apps") + f'{"?chainId=10"}'
+        url = reverse("safe-apps:list") + f'{"?chainId=10"}'
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -159,7 +159,7 @@ def test_apps_returned_on_same_key_pair(self):
                 "provider": None,
             }
         ]
-        url = reverse("v1:safe-apps") + f'{"?chainId=2&chainId=1"}'
+        url = reverse("safe-apps:list") + f'{"?chainId=2&chainId=1"}'
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -182,7 +182,7 @@ def test_provider_returned_in_response(self):
                 "provider": {"name": provider.name, "url": provider.url},
             }
         ]
-        url = reverse("v1:safe-apps")
+        url = reverse("safe-apps:list")
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -202,7 +202,7 @@ def test_provider_not_returned_in_response(self):
                 "provider": None,
             }
         ]
-        url = reverse("v1:safe-apps")
+        url = reverse("safe-apps:list")
 
         response = self.client.get(path=url, data=None, format="json")
 
@@ -224,7 +224,7 @@ def test_should_cache_response(self):
                 "provider": None,
             }
         ]
-        url = reverse("v1:safe-apps")
+        url = reverse("safe-apps:list")
 
         response = self.client.get(path=url, data=None, format="json")