Skip to content

Commit

Permalink
[codegen] update to latest api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed May 30, 2024
1 parent 279fae0 commit 36f27a2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
if (ApiTypeHelper.isDefined(this.storedFields)) {
generator.writeKey("stored_fields");
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);
if (this.storedFields.size() == 1) {
String singleItem = this.storedFields.get(0);
generator.write(singleItem);

} else {
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);

}
generator.writeEnd();
}
generator.writeEnd();

}
if (this.suggest != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1060,12 +1060,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
if (ApiTypeHelper.isDefined(this.storedFields)) {
generator.writeKey("stored_fields");
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);
if (this.storedFields.size() == 1) {
String singleItem = this.storedFields.get(0);
generator.write(singleItem);

} else {
generator.writeStartArray();
for (String item0 : this.storedFields) {
generator.write(item0);

}
generator.writeEnd();
}
generator.writeEnd();

}
if (this.suggest != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
public class Hit<TDocument> implements JsonpSerializable {
private final String index;

@Nullable
private final String id;

@Nullable
Expand Down Expand Up @@ -127,7 +128,7 @@ public class Hit<TDocument> implements JsonpSerializable {
private Hit(Builder<TDocument> builder) {

this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
this.id = builder.id;
this.score = builder.score;
this.type = builder.type;
this.explanation = builder.explanation;
Expand Down Expand Up @@ -161,8 +162,9 @@ public final String index() {
}

/**
* Required - API name: {@code _id}
* API name: {@code _id}
*/
@Nullable
public final String id() {
return this.id;
}
Expand Down Expand Up @@ -311,9 +313,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("_index");
generator.write(this.index);

generator.writeKey("_id");
generator.write(this.id);
if (this.id != null) {
generator.writeKey("_id");
generator.write(this.id);

}
if (this.score != null) {
generator.writeKey("_score");
generator.write(this.score);
Expand Down Expand Up @@ -458,6 +462,7 @@ public static class Builder<TDocument> extends WithJsonObjectBuilderBase<Builder
ObjectBuilder<Hit<TDocument>> {
private String index;

@Nullable
private String id;

@Nullable
Expand Down Expand Up @@ -523,9 +528,9 @@ public final Builder<TDocument> index(String value) {
}

/**
* Required - API name: {@code _id}
* API name: {@code _id}
*/
public final Builder<TDocument> id(String value) {
public final Builder<TDocument> id(@Nullable String value) {
this.id = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2351,10 +2351,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/3458c5d2594e7ad33da1b128469faa09881bbead/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/60128dd705a0e7c7f4da6044f1c54ff6a86157eb/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/3458c5d2594e7ad33da1b128469faa09881bbead/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/60128dd705a0e7c7f4da6044f1c54ff6a86157eb/specification/">Elasticsearch API specification</a>.
</body>
</html>

0 comments on commit 36f27a2

Please sign in to comment.