Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(scripts): state which SDK verbs the coverage gate checks

Yudhi Armyndharis4ef85e37b859
diff --git a/scripts/check-sdk-coverage.mjs b/scripts/check-sdk-coverage.mjs
index e2dde7d93..777d2780a 100644
--- a/scripts/check-sdk-coverage.mjs
+++ b/scripts/check-sdk-coverage.mjs
@@ -15,8 +15,11 @@
* client, not just the route.
*
* SCOPE, stated so the guarantee is not read wider than it is:
- * - Asserts a route is REACHABLE from each client with the verbs the contract declares on it,
- * not that its body or response match.
+ * - Asserts a route is REACHABLE from each client, that each verb of a multi-verb route is built,
+ * and that no verb/path pair the verb scan harvests uses a verb the contract does not declare;
+ * not that its body or response match. A call the scan cannot pair with its path (the messages
+ * send-<type> helpers, binary downloads, Go's service helpers and `path :=` variables) is not
+ * verb-checked, so a wrong verb on a single-verb route built that way passes.
* - The exclusion list is PARSED from sdk/README.md, so the gate and the promise cannot drift.
*
* The harvester is deliberately GENEROUS: it over-approximates what each client builds. That is the
@@ -251,7 +254,9 @@ if (!errors.length) {
// question in both directions. For every contract path published with MORE THAN ONE verb, each
// client must build that path with every verb the contract declares on it. And every verb a client
// builds on a contract path must be one the contract declares there, which is what covers the
-// single-verb paths: the path layer only proves the path is reached, never with which verb.
+// single-verb paths: the path layer only proves the path is reached, never with which verb. That
+// second check sees only the pairs harvested below; a call the scan cannot pair with its path (see
+// the SCOPE note at the top) is not checked.
const VERBS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
/** Join a concatenated path expression: literals verbatim, code between them becomes a `*`. */