Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Oct 4, 2024
1 parent b528245 commit 8c9369e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/src/mock.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ page.route("*/**/api/v1/fruits", route -> {
Response response = route.fetch();
byte[] json = response.body();
JsonObject parsed = new Gson().fromJson(new String(json), JsonObject.class);
parsed.add("name", new JsonPrimitive("Loquat"));
parsed.add("id", new JsonPrimitive(100));
parsed.add(new JsonObject().add("name", "Loquat").add("id", 100));
// Fulfill using the original response, while patching the response body
// with the given JSON object.
route.fulfill(new Route.FulfillOptions().setResponse(response).setBody(parsed.toString()));
Expand Down

0 comments on commit 8c9369e

Please sign in to comment.