about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi <frederick@fallion.localhost>2026-08-28 15:44:53 +0000
committerFrederick Muriuki Muriithi <fredmanglis@gmail.com>2026-08-28 10:49:47 -0500
commitea63ab82f6f86236c1eb0afc99b3247bff2bc099 (patch)
treee0054163315386eced2c3d2a08b0e7712045c736
parent23a02f751865ab706a6fefae668dfa67c4ad27d2 (diff)
downloadgenenetwork3-ea63ab82f6f86236c1eb0afc99b3247bff2bc099.tar.gz
feat(case-attr): add deprecation headers to flat caseattr blueprint
All flat /case-attribute/ endpoints now return:
  Deprecation: true
  Link: </api/v1/>; rel="successor-version"

Implemented via @caseattr.after_request so it applies automatically to
every existing and future flat endpoint without per-function changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reviewed-By: Frederick M. Muriith <fredmanglis@gmail.com>
-rw-r--r--gn3/api/case_attributes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gn3/api/case_attributes.py b/gn3/api/case_attributes.py
index 3d836fc..2e7dfc0 100644
--- a/gn3/api/case_attributes.py
+++ b/gn3/api/case_attributes.py
@@ -35,6 +35,13 @@ caseattr = Blueprint("case-attribute", __name__)
 caseattrsbp = Blueprint("case-attributes", __name__)
 
 
+@caseattr.after_request
+def add_deprecation_headers(response):
+    response.headers["Deprecation"] = "true"
+    response.headers["Link"] = '</api/v1/>; rel="successor-version"'
+    return response
+
+
 def required_access(
         token: dict,
         inbredset_id: int,