From b94aa1269db16fe56b0025735737ccfa6b9cddab Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 28 Oct 2026 05:37:12 +0000 Subject: [PATCH] feat: expose method source in API discovery Set the expose_discovery_source hook. The API discovery endpoints then show the source code of whitelisted methods of this app. This helps API clients, such as AI agents, to understand what a method does. The app is open source, thus it is safe to show the source. Co-Authored-By: Claude Opus 5.5 --- webshop/hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webshop/hooks.py b/webshop/hooks.py index a9adb8c86e..fbfcf7df97 100644 --- a/webshop/hooks.py +++ b/webshop/hooks.py @@ -74,3 +74,7 @@ "Website Item": "webshop.webshop.doctype.website_item.website_item.has_website_permission_for_website_item", "Item Group": "webshop.webshop.doctype.website_item.website_item.has_website_permission_for_item_group", } + +# Expose method source code through the API discovery endpoints. Safe for open +# source apps and helps API clients understand what a method does. +expose_discovery_source = True