Skip to content

[es/snapshot.create] Missing required property 'CreateSnapshotResponse.snapshot' #132

Closed
@jloisel

Description

@jloisel

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client code

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions