Browse Source

chore: When fetching doc metadata, check if required keys are present (#35258)

Alberto Leal 2 years ago
parent
commit
9f9327cafd
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/sentry/api/endpoints/project_docs_platform.py

+ 4 - 0
src/sentry/api/endpoints/project_docs_platform.py

@@ -40,6 +40,10 @@ class ProjectDocsPlatformEndpoint(ProjectEndpoint):
         data = load_doc(platform)
         if not data:
             raise ResourceDoesNotExist
+        keys = ("id", "name", "html", "link")
+        for key in keys:
+            if key not in data:
+                raise ResourceDoesNotExist
 
         project_key = ProjectKey.get_default(project)