From d05e56eed66ba6036b8b055556cdfc06f5384b78 Mon Sep 17 00:00:00 2001 From: Prabal Tripathi Date: Tue, 24 Nov 2026 13:32:19 +0530 Subject: [PATCH 1/5] docs: document per-endpoint noise in keploy.yml test.globalNoise gets an endpoints list (keploy/keploy#5409): noise for one endpoint, at an exact field path from the top of the response body. The configuration page now describes the rule's shape, which tests it applies to, how body paths, arrays, id keys, patterns and overlaps are read, and how keploy cloud replay combines keploy.yml's rules with the ones saved in the dashboard. Signed-off-by: Prabal Tripathi --- .../running-keploy/configuration-file.md | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md index 58d83adc0..1c3ecf453 100644 --- a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md +++ b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md @@ -227,7 +227,7 @@ The `test` section in the Keploy-config file allows you to define parameters for "test-set-2": [] ``` -- **`globalNoise`**: Noisy fields to be ignored at global/test-set level. +- **`globalNoise`**: Noisy fields to be ignored at global, Test-Set or endpoint level. Example: ```yml @@ -468,6 +468,37 @@ test-sets: {test-set-1: {body: { - **`body`**: Defines patterns to ignore for the response body within the specified test set. - **`header`**: Specifies headers or header values to be ignored for the specified test set. Example: `{"User-Agent": ["PostmanRuntime/7.34.0"]}` +### Endpoint noise + +Global noise ignores a field name in every response, and a dotted path wherever the path appears in a response. To ignore a field for one endpoint only, at its exact place in the body, use the `endpoints` subsection of `globalNoise`: + +```yml +globalNoise: + global: {} + test-sets: {} + endpoints: + - method: GET # optional; leave it out to match any method + path: /version # the request path; {name} matches one path segment + body: + version: [] # only the top-level "version" of GET /version + header: + X-Build-Id: [] # the exact header name, in any case + - path: /apps/{id}/status + body: + data.heartbeats[].at: ["^2026-"] # ignore it only while both values match +``` + +How Keploy reads an endpoint rule: + +- **Which tests it applies to:** a test whose recorded request has the rule's method (in any case) and path. The host, the query string and a trailing `/` are ignored, and a `{name}` segment matches any one segment. +- **Body fields:** a dotted path from the top of the response body, matched exactly. `version` is only the top-level `version`; `data.version` never matches `metadata.version` or `data.versionLabel`. A rule on a field also covers everything under it. +- **Arrays:** `data.items.at` and `data.items[].at` mean the same thing, the `at` of every item. You can't pick one element, so `items[0].at` matches nothing. When the whole response is an array, start from its items' keys: `items.version`. +- **Maps keyed by IDs:** `{id}` stands for an ID key, for example `results.{id}.traceId`. +- **Values:** `[]` ignores any value. A list of regular expressions ignores the field only when both the recorded and the replayed value match one of them, as for other noise. +- **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. A test case's own noise for the same field wins over an endpoint rule. + +Endpoint noise applies to HTTP test responses. It doesn't change how Keploy matches mocks. With `keploy cloud replay`, the rules saved for the app in the dashboard are added after the rules in `keploy.yml`, so your own rule decides when both name the same field. + ## Handling Deeply Nested JSON Fields in Keploy Configuration 🧩 When dealing with deeply nested JSON fields in the response body, it’s important to correctly specify the path to the fields in the Keploy configuration file. Here’s an example to illustrate how to add a nested `token` field to the global noise configuration. @@ -515,7 +546,7 @@ By specifying the path in this manner, Keploy will correctly identify and handle ### **Note**: -The `globalNoise` and `test-sets` are optional fields in the config file. If not specified, the default value for both fields is an empty object `{}`. This flexibility allows you to seamlessly integrate advanced noise filtering based on your testing requirements. +The `global`, `test-sets` and `endpoints` fields of `globalNoise` are optional. If not specified, `global` and `test-sets` default to an empty object `{}` and `endpoints` to an empty list. This flexibility allows you to seamlessly integrate advanced noise filtering based on your testing requirements. ## Conclusion From f51a94d9f01e200bb91fb7de9c7d66626d338483 Mon Sep 17 00:00:00 2001 From: Prabal Tripathi Date: Tue, 24 Nov 2026 13:42:47 +0530 Subject: [PATCH 2/5] docs: correct and complete the endpoint noise section Review fixes: a top-level array starts from its elements' keys (`version` or `[].version`); endpoint noise does not apply to streamed or gRPC responses; `{id}` in a body path is defined (which keys count as IDs, and that a new ID is still a difference); body paths match without case and may start with `$.`; `path` is required and case-sensitive; header names match exactly; how rules on different fields and global field names combine. The example sits under `test:` and uses a date pattern that does not expire. Keploy terms and serial commas follow STYLE.md. Signed-off-by: Prabal Tripathi --- .../running-keploy/configuration-file.md | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md index 1c3ecf453..7888d6f97 100644 --- a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md +++ b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md @@ -227,7 +227,7 @@ The `test` section in the Keploy-config file allows you to define parameters for "test-set-2": [] ``` -- **`globalNoise`**: Noisy fields to be ignored at global, Test-Set or endpoint level. +- **`globalNoise`**: Noisy fields to be ignored at global, Test-Set, or endpoint level. Example: ```yml @@ -473,31 +473,33 @@ test-sets: {test-set-1: {body: { Global noise ignores a field name in every response, and a dotted path wherever the path appears in a response. To ignore a field for one endpoint only, at its exact place in the body, use the `endpoints` subsection of `globalNoise`: ```yml -globalNoise: - global: {} - test-sets: {} - endpoints: - - method: GET # optional; leave it out to match any method - path: /version # the request path; {name} matches one path segment - body: - version: [] # only the top-level "version" of GET /version - header: - X-Build-Id: [] # the exact header name, in any case - - path: /apps/{id}/status - body: - data.heartbeats[].at: ["^2026-"] # ignore it only while both values match +test: + globalNoise: + global: {} + test-sets: {} + endpoints: + - method: GET # optional; leave it out to match any method + path: /version # required: the request path; {name} matches one path segment + body: + version: [] # only the top-level "version" of GET /version + header: + X-Build-Id: [] # this header name exactly, in any case + - path: /apps/{id}/status + body: + data.heartbeats[].at: ['^\d{4}-\d{2}-\d{2}T'] # ignore it only while both values match ``` How Keploy reads an endpoint rule: -- **Which tests it applies to:** a test whose recorded request has the rule's method (in any case) and path. The host, the query string and a trailing `/` are ignored, and a `{name}` segment matches any one segment. -- **Body fields:** a dotted path from the top of the response body, matched exactly. `version` is only the top-level `version`; `data.version` never matches `metadata.version` or `data.versionLabel`. A rule on a field also covers everything under it. -- **Arrays:** `data.items.at` and `data.items[].at` mean the same thing, the `at` of every item. You can't pick one element, so `items[0].at` matches nothing. When the whole response is an array, start from its items' keys: `items.version`. -- **Maps keyed by IDs:** `{id}` stands for an ID key, for example `results.{id}.traceId`. +- **Which Test-Cases it applies to:** a Test-Case whose recorded request has the rule's `path` and, when the rule sets one, its `method` (in any case). `path` is required and case-sensitive. Keploy ignores the host, the query string, and a trailing `/`, and a `{name}` segment matches any one non-empty segment. +- **Body fields:** a dotted path from the top of a JSON response body, matched exactly except for case. `version` is only the top-level `version`; `data.version` never matches `metadata.version` or `data.versionLabel`. A rule on a field also covers everything under it. A leading `$.` is optional. +- **Arrays:** `data.items.at` and `data.items[].at` mean the same thing, the `at` of every item. You can't pick one element, so `items[0].at` matches nothing. When the whole response is an array, start from the keys of its elements: for `[{"version": "1.2"}]`, write `version` or `[].version`. +- **Maps keyed by IDs:** in a body path, `{id}` stands for any key that is an ID: a UUID, a ULID, 16 or more hex characters with at least one digit, or 10 or more digits. For example, `results.{id}.traceId` names `traceId` under every such key of `results`. Write other keys, such as `42` or `user-7`, out in full. `{id}` covers only the IDs in the recorded response, so an ID that appears only in the replayed response is still a difference. +- **Headers:** the exact header name, in any case. Unlike global header noise, `X-Build` doesn't match `X-Build-Id`. - **Values:** `[]` ignores any value. A list of regular expressions ignores the field only when both the recorded and the replayed value match one of them, as for other noise. -- **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. A test case's own noise for the same field wins over an endpoint rule. +- **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. Rules that name different fields all apply: a rule on `data` covers `data.version` wherever it is in the list. A Test-Case's own noise for the same field wins over an endpoint rule, and an endpoint rule can't narrow a field name in `global` or `test-sets`: `version: []` there ignores `version` in every response. -Endpoint noise applies to HTTP test responses. It doesn't change how Keploy matches mocks. With `keploy cloud replay`, the rules saved for the app in the dashboard are added after the rules in `keploy.yml`, so your own rule decides when both name the same field. +Endpoint noise applies to HTTP test responses that aren't streamed. Keploy compares streamed responses, such as server-sent events, and gRPC responses without endpoint rules, and endpoint rules don't change how Keploy matches mocks. `keploy cloud replay` adds the endpoint rules saved for the app in the Keploy dashboard after the rules in `keploy.yml`, so your rule decides when both name the same field. ## Handling Deeply Nested JSON Fields in Keploy Configuration 🧩 @@ -546,7 +548,7 @@ By specifying the path in this manner, Keploy will correctly identify and handle ### **Note**: -The `global`, `test-sets` and `endpoints` fields of `globalNoise` are optional. If not specified, `global` and `test-sets` default to an empty object `{}` and `endpoints` to an empty list. This flexibility allows you to seamlessly integrate advanced noise filtering based on your testing requirements. +The `global`, `test-sets`, and `endpoints` fields of `globalNoise` are optional. If not specified, `global` and `test-sets` default to an empty object `{}` and `endpoints` to an empty list. This flexibility allows you to seamlessly integrate advanced noise filtering based on your testing requirements. ## Conclusion From 933d991f920bd26820a99e714e9eff83d5639ce5 Mon Sep 17 00:00:00 2001 From: Prabal Tripathi Date: Tue, 24 Nov 2026 13:47:13 +0530 Subject: [PATCH 3/5] docs: clarify which responses endpoint noise skips Review round 2: say plainly that streamed and gRPC responses get no endpoint rules, and that a global or test-set field name ignores the field in the responses it applies to. Signed-off-by: Prabal Tripathi --- .../version-4.0.0/running-keploy/configuration-file.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md index 7888d6f97..f02445eba 100644 --- a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md +++ b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md @@ -497,9 +497,9 @@ How Keploy reads an endpoint rule: - **Maps keyed by IDs:** in a body path, `{id}` stands for any key that is an ID: a UUID, a ULID, 16 or more hex characters with at least one digit, or 10 or more digits. For example, `results.{id}.traceId` names `traceId` under every such key of `results`. Write other keys, such as `42` or `user-7`, out in full. `{id}` covers only the IDs in the recorded response, so an ID that appears only in the replayed response is still a difference. - **Headers:** the exact header name, in any case. Unlike global header noise, `X-Build` doesn't match `X-Build-Id`. - **Values:** `[]` ignores any value. A list of regular expressions ignores the field only when both the recorded and the replayed value match one of them, as for other noise. -- **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. Rules that name different fields all apply: a rule on `data` covers `data.version` wherever it is in the list. A Test-Case's own noise for the same field wins over an endpoint rule, and an endpoint rule can't narrow a field name in `global` or `test-sets`: `version: []` there ignores `version` in every response. +- **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. Rules that name different fields all apply: a rule on `data` covers `data.version` wherever it is in the list. A Test-Case's own noise for the same field wins over an endpoint rule, and an endpoint rule can't narrow a field name in `global` or `test-sets`: `version: []` there ignores `version` in every response it applies to, whatever an endpoint rule's patterns say. -Endpoint noise applies to HTTP test responses that aren't streamed. Keploy compares streamed responses, such as server-sent events, and gRPC responses without endpoint rules, and endpoint rules don't change how Keploy matches mocks. `keploy cloud replay` adds the endpoint rules saved for the app in the Keploy dashboard after the rules in `keploy.yml`, so your rule decides when both name the same field. +Endpoint noise applies to HTTP test responses that aren't streamed. Keploy doesn't apply endpoint rules to streamed responses, such as server-sent events, or to gRPC responses, and endpoint rules don't change how Keploy matches mocks. `keploy cloud replay` adds the endpoint rules saved for the app in the Keploy dashboard after the rules in `keploy.yml`, so your rule decides when both name the same field. ## Handling Deeply Nested JSON Fields in Keploy Configuration 🧩 From ae65c03bb131d1ae6a9c736ed5d6801281ffa5d6 Mon Sep 17 00:00:00 2001 From: Prabal Tripathi Date: Thu, 26 Nov 2026 00:10:04 +0530 Subject: [PATCH 4/5] docs: note that --trigger replays use only the dashboard's endpoint rules Signed-off-by: Prabal Tripathi --- .../version-4.0.0/running-keploy/configuration-file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md index f02445eba..e4b8ee3fd 100644 --- a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md +++ b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md @@ -499,7 +499,7 @@ How Keploy reads an endpoint rule: - **Values:** `[]` ignores any value. A list of regular expressions ignores the field only when both the recorded and the replayed value match one of them, as for other noise. - **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. Rules that name different fields all apply: a rule on `data` covers `data.version` wherever it is in the list. A Test-Case's own noise for the same field wins over an endpoint rule, and an endpoint rule can't narrow a field name in `global` or `test-sets`: `version: []` there ignores `version` in every response it applies to, whatever an endpoint rule's patterns say. -Endpoint noise applies to HTTP test responses that aren't streamed. Keploy doesn't apply endpoint rules to streamed responses, such as server-sent events, or to gRPC responses, and endpoint rules don't change how Keploy matches mocks. `keploy cloud replay` adds the endpoint rules saved for the app in the Keploy dashboard after the rules in `keploy.yml`, so your rule decides when both name the same field. +Endpoint noise applies to HTTP test responses that aren't streamed. Keploy doesn't apply endpoint rules to streamed responses, such as server-sent events, or to gRPC responses, and endpoint rules don't change how Keploy matches mocks. `keploy cloud replay` adds the endpoint rules saved for the app in the Keploy dashboard after the rules in `keploy.yml`, so your rule decides when both name the same field. With `--trigger`, the replay runs in the cluster with only the rules saved in the dashboard; the rules in `keploy.yml` are not applied. ## Handling Deeply Nested JSON Fields in Keploy Configuration 🧩 From 2bd9f4d4ede1bdf2686da9aad06304fcb6c26d83 Mon Sep 17 00:00:00 2001 From: Prabal Tripathi Date: Thu, 26 Nov 2026 14:09:09 +0530 Subject: [PATCH 5/5] docs: say an endpoint rule only adds to global and test-set noise A rule cannot narrow a body field or a header that global or test-set noise covers, and where both give patterns, a value either one matches is ignored. keploy test warns about a rule that can never match. Signed-off-by: Prabal Tripathi --- .../version-4.0.0/running-keploy/configuration-file.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md index e4b8ee3fd..2509c942a 100644 --- a/versioned_docs/version-4.0.0/running-keploy/configuration-file.md +++ b/versioned_docs/version-4.0.0/running-keploy/configuration-file.md @@ -497,7 +497,8 @@ How Keploy reads an endpoint rule: - **Maps keyed by IDs:** in a body path, `{id}` stands for any key that is an ID: a UUID, a ULID, 16 or more hex characters with at least one digit, or 10 or more digits. For example, `results.{id}.traceId` names `traceId` under every such key of `results`. Write other keys, such as `42` or `user-7`, out in full. `{id}` covers only the IDs in the recorded response, so an ID that appears only in the replayed response is still a difference. - **Headers:** the exact header name, in any case. Unlike global header noise, `X-Build` doesn't match `X-Build-Id`. - **Values:** `[]` ignores any value. A list of regular expressions ignores the field only when both the recorded and the replayed value match one of them, as for other noise. -- **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. Rules that name different fields all apply: a rule on `data` covers `data.version` wherever it is in the list. A Test-Case's own noise for the same field wins over an endpoint rule, and an endpoint rule can't narrow a field name in `global` or `test-sets`: `version: []` there ignores `version` in every response it applies to, whatever an endpoint rule's patterns say. +- **Rules that match nothing:** `keploy test` warns about a rule with no path, a path that holds a host, a query, a fragment or a method (such as a pasted URL or `GET /version`), a body field that names one array element, or no fields at all. +- **Overlaps:** when several rules match a request and name the same field, the first rule in the list decides. Rules that name different fields all apply: a rule on `data` covers `data.version` wherever it is in the list. A Test-Case's own noise for the same field wins over an endpoint rule. An endpoint rule only adds to `global` and `test-sets`, for body fields and headers alike: `version: []` or `X-Build: []` there ignores that field in every response it applies to, whatever an endpoint rule's patterns say. When both give patterns for a field, a value that either one's patterns match is ignored. Endpoint noise applies to HTTP test responses that aren't streamed. Keploy doesn't apply endpoint rules to streamed responses, such as server-sent events, or to gRPC responses, and endpoint rules don't change how Keploy matches mocks. `keploy cloud replay` adds the endpoint rules saved for the app in the Keploy dashboard after the rules in `keploy.yml`, so your rule decides when both name the same field. With `--trigger`, the replay runs in the cluster with only the rules saved in the dashboard; the rules in `keploy.yml` are not applied.