Skip to content

Commit b7d1742

Browse files
authored
Include withJson docs only in correct versions (#217)
1 parent 0b47eff commit b7d1742

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/index.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
include::{asciidoc-dir}/../../shared/versions/stack/{source_branch}.asciidoc[]
44
include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
55

6+
include::_releases.asciidoc[]
7+
68
:java-client: Java API Client
79
:doc-tests: {docdir}/../java-client/src/test/java/co/elastic/clients/documentation
810

@@ -25,7 +27,9 @@ include::installation.asciidoc[]
2527
include::connecting.asciidoc[]
2628
include::migrate.asciidoc[]
2729
include::api-conventions.asciidoc[]
30+
ifdef::is_main_branch,v8_1_1_released,v7_17_2_released[]
2831
include::loading-json.asciidoc[]
32+
endif::is_main_branch,v8_1_1_released,v7_17_2_released[]
2933
include::javadoc-and-source.asciidoc[]
3034

3135
include::{elasticsearch-root}/docs/java-rest/low-level/index.asciidoc[]

docs/loading-json.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
[[loading-json]]
22
== Creating API objects from JSON data
33

4+
ifeval::["{minor-version}" == "7.17"]
5+
NOTE: This feature was added in version 7.17.2
6+
endif::[]
7+
8+
ifeval::["{minor-version}" == "8.1"]
9+
NOTE: This feature was added in version 8.1.1
10+
endif::[]
11+
412
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.
513

614
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.

0 commit comments

Comments
 (0)