From d6b7a987845fa1aec35a7d081f12f16d5bf74282 Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Mon, 28 Mar 2022 16:04:13 +0200 Subject: [PATCH] Include withJson docs only in correct versions (#217) --- docs/index.asciidoc | 4 ++++ docs/loading-json.asciidoc | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 2d604bd06..5a8694473 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -3,6 +3,8 @@ include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[] include::{asciidoc-dir}/../../shared/attributes.asciidoc[] +include::_releases.asciidoc[] + :java-client: Java API Client :doc-tests: {docdir}/../java-client/src/test/java/co/elastic/clients/documentation @@ -25,7 +27,9 @@ include::installation.asciidoc[] include::connecting.asciidoc[] include::migrate.asciidoc[] include::api-conventions.asciidoc[] +ifdef::is_main_branch,v8_1_1_released,v7_17_2_released[] include::loading-json.asciidoc[] +endif::is_main_branch,v8_1_1_released,v7_17_2_released[] include::javadoc-and-source.asciidoc[] include::{elasticsearch-root}/docs/java-rest/low-level/index.asciidoc[] diff --git a/docs/loading-json.asciidoc b/docs/loading-json.asciidoc index c323b5884..39a3b2293 100644 --- a/docs/loading-json.asciidoc +++ b/docs/loading-json.asciidoc @@ -1,6 +1,14 @@ [[loading-json]] == Creating API objects from JSON data +ifeval::["{minor-version}" == "7.17"] +NOTE: This feature was added in version 7.17.2 +endif::[] + +ifeval::["{minor-version}" == "8.1"] +NOTE: This feature was added in version 8.1.1 +endif::[] + A common workflow during application development with Elasticsearch is to use the Kibana Developer Console to interactively prepare and test queries, aggregations, index mappings and other complex API calls. This results in working JSON snippets that you may want to use in your application. As translating these JSON snippets to Java code can be time-consuming and error-prone, most of the data classes in the {java-client} can be loaded from JSON text: object builders have `withJson()` methods that populate the builder from raw JSON. This also allows you to combine dynamically loaded JSON with programmatic construction of objects.