From cca7f9b6beba3d211d323a7efa5d102512792524 Mon Sep 17 00:00:00 2001 From: dancer13 Date: Fri, 4 Oct 2024 01:09:25 +0200 Subject: [PATCH] doc(README.md): fix wrong variable declared (#4732) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fe7c30b0a..8f1025edda 100644 --- a/README.md +++ b/README.md @@ -240,7 +240,7 @@ ObjectMapper mapper = ...; File jsonFile = new File("test.json"); // note: method added in Jackson 2.11 (earlier would need to use // mapper.getFactory().createGenerator(...) -JsonGenerator g = f.createGenerator(jsonFile, JsonEncoding.UTF8); +JsonGenerator g = mapper.createGenerator(jsonFile, JsonEncoding.UTF8); // write JSON: { "message" : "Hello world!" } g.writeStartObject(); g.writeStringField("message", "Hello world!");