Error using bodyFilter with jsonPath
See original GitHub issueI’m using logbook version 2.9.0 and I’d like to mask a specific attribute (cpf) in the request and response body. The bean that I created is below:
@Bean
public Logbook logbook() {
return Logbook.builder()
.bodyFilter(jsonPath("$.cpf").replace(compile("(\\d{3})(\\d{3})(\\d{3})-?(\\d{2})"), "$1.XXX.$3-XX"))
.bodyFilter(jsonPath("$.results.client.cpf").replace(compile("(\\d{3})(\\d{3})(\\d{3})-?(\\d{2})"), "$1.XXX.$3-XX"))
.build();
}
When I make an request with body {“cpf”: “21343575698”}, an error occur: “Missing property in path $[‘results’]”,“trace”:“com.jayway.jsonpath.PathNotFoundException: Missing property in path $[‘results’]”
is there something wrong with my configuration?
Thanks a lot.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
"Found nothing" error with JSONPath filter and gatling
Your expression is correct, this was indeed a bug. It's fixed in 0.6.3 that was just released. Thanks for reporting.
Read more >BodyFilters (Logbook: Core 1.12.1 API) - javadoc.io
Creates a BodyFilter that replaces the properties in the json response with the replacement passed as argument. This BodyFilter works on all levels...
Read more >Using JSON API to query your Search API indexes - matt glaman
The JSON API module exposes collection routes, which allows retrieving multiple resources in a single request. You can also pass filters to ...
Read more >Activate API management - Airheads Community
I'm doing a very simple python 3 Script to query the activate inventory. The problem is that the server is ignoring the body...
Read more >net45/Resources/interconnecttaskMetadata ... - PowerShell Gallery
net45/Resources/interconnecttaskMetadata.json ... ","structure_id":"com.vmware.vapi.std.errors.unauthorized"},{"documentation":"Internal Server Error" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like the problem of throwing an exception if a path is missing still exists. This prevents valid paths from being parsed and filtered
@whiskeysierra are jsonpath body filters are still experimental feature or can be used in real time projects?