Closed
Description
Logs:
co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'CreateSnapshotResponse.snapshot'
at co.elastic.clients.elasticsearch.snapshot.CreateSnapshotResponse$Builder.build(CreateSnapshotResponse.java:111)
at co.elastic.clients.elasticsearch.snapshot.CreateSnapshotResponse$Builder.build(CreateSnapshotResponse.java:149)
at co.elastic.clients.elasticsearch.snapshot.CreateSnapshotResponse.<init>(CreateSnapshotResponse.java:50)
at co.elastic.clients.elasticsearch.snapshot.CreateSnapshotResponse.<init>(CreateSnapshotResponse.java:61)
co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'CreateSnapshotResponse.snapshot'
Java code which creates the snapshot:
final CreateSnapshotRequest request = new CreateSnapshotRequest
.Builder()
.repository(repository)
.snapshot(name)
.ignoreUnavailable(true)
.includeGlobalState(true)
.build();
client.create(request);
The snapshot is successfully created on Elasticsearch, but the code fails to parse the response from the server, which simply returns:
{
"accepted": true
}
But the sdk requires a non-null snapshot:
private CreateSnapshotResponse(Builder builder) {
this.accepted = builder.accepted;
this.snapshot = ApiTypeHelper.requireNonNull(builder.snapshot, this, "snapshot");
}
Am I missing something here?