keploy / keploy/keploy

[bug]: Global noise configuration not get applied during replay for json structure to validate and ignore the data value

Open
#3,492 8 comments 0 reactions 0 assignees View on GitHub
bug integration-testing keploy
Dominant language
Go
Stars
18.5k
Forks
2.4k
Avg merge
1d 4h
Merged PRs (30d)
101

Description

### 👀 Is there an existing issue for this?

- [x] I have searched and didn't find similar issue

### 👍 Current behavior

During Replay part we would like to validate the JSON structure and want to ignore values. Currently specifying in individual test case file with exact name of json field, it is working fine.
e.g
noise :
response.data: []
However, there are endpoint which returns around 50-60 json fields. Pl suggest if any global level configuration which would check the json structure but ignore values without specifying individual field. Have tried with Global noise section with below configuration, still it did not work and test case fails. Pl provide guidance on this.
global:
- response:
body:
".*": [] # Regex to match all fields in the JSON body
- request:

global:
- response:
body:
- $..*

### 👟 Steps to Replicate

update keploy config with below value and replay (keploy test)
global:
- response:
body:
".*": [] # Regex to match all fields in the JSON body

### 📜 Logs (if any)

_No response_

### 💻 Operating system

Linux

### 🧾 System Info (`uname -a`)

_No response_

### 📦 OS Release Info (`cat /etc/os-release`)

_No response_

### 🐳 Docker Info (if applicable)

_No response_

### 🧱 Your Environment

_No response_

### 🎲 Version

2.11.34

### 📦 Repository

keploy

### 🤔 What use case were you trying? (optional)

_No response_

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is named. Reproduce `keploy test` with the shown global noise configuration on version 2.11.34, then trace replay handling of global JSON noise rules; done means the configuration validates the JSON structure while ignoring its values without per-test field entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, yaml
Domain
api, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.