From c779ad36842f8ef385fe3dc7f60141f05d073004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6rdes?= Date: Thu, 5 Sep 2024 17:26:22 +0200 Subject: [PATCH] requested changes --- .../message-transformation/replace/README.md | 18 +++++++----------- .../message-transformation/replace/proxies.xml | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/distribution/examples/message-transformation/replace/README.md b/distribution/examples/message-transformation/replace/README.md index 2af2e261e..d6657339f 100644 --- a/distribution/examples/message-transformation/replace/README.md +++ b/distribution/examples/message-transformation/replace/README.md @@ -9,23 +9,19 @@ The `Replace`plugin allows you to modify values in your JSON by using a `jsonPat ```shell curl localhost:2000 \ -H "Content-Type: application/json" \ - -d '{"shop": {"name": "MyShop", "location": "Berlin"}}' - ``` -3. Check the console, and you'll notice that the JSON with the name field set to `foo` is logged. - ``` - [RouterThread /127.0.0.1:33632] INFO com.predic8.membrane.core.interceptor.LogInterceptor - Body: - [RouterThread /127.0.0.1:33632] INFO com.predic8.membrane.core.interceptor.LogInterceptor - {"shop":{"name":"foo","location":"Berlin"}} - [RouterThread /127.0.0.1:33632] INFO com.predic8.membrane.core.interceptor.LogInterceptor - ================ - [RouterThread /127.0.0.1:33632] INFO com.predic8.membrane.core.interceptor.LogInterceptor - ==== Response === - [RouterThread /127.0.0.1:33632] INFO com.predic8.membrane.core.interceptor.LogInterceptor - HTTP/1.1 200 Ok + -d '{"user": {"name": "Alice", "age": 22}}' ``` + and take a look at the output: + ```json + {"user":{"name":"Bob","age":22}} + ``` ## Configuration This configuration sets up an API that replaces the value of the `name` field under the `shop object` in the JSON body with "foo", before forwarding the request to a target service running on localhost at port 3000. ```xml - - + + ``` \ No newline at end of file diff --git a/distribution/examples/message-transformation/replace/proxies.xml b/distribution/examples/message-transformation/replace/proxies.xml index 7b99622cf..0af0f8650 100644 --- a/distribution/examples/message-transformation/replace/proxies.xml +++ b/distribution/examples/message-transformation/replace/proxies.xml @@ -7,7 +7,7 @@ - +