Skip to content

Commit cb3dc1a

Browse files
committed
Fix reference to XContentBuilder.string() (#31337)
In 6.3 this was moved to `Strings.toString(XContentBuilder)` as part of the XContent extraction. This commit fixes the docs to reference the new method. Resolves #31326
1 parent d9d8c8a commit cb3dc1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/java-api/docs/index_.asciidoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ Note that you can also add arrays with `startArray(String)` and
9999
other XContentBuilder objects.
100100

101101
If you need to see the generated JSON content, you can use the
102-
`string()` method.
102+
`Strings.toString()` method.
103103

104104
[source,java]
105105
--------------------------------------------------
106-
String json = builder.string();
106+
import org.elasticsearch.common.Strings;
107+
108+
String json = Strings.toString(builder);
107109
--------------------------------------------------
108110

109111

0 commit comments

Comments
 (0)