Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jloisel opened this issue Jan 25, 2022 · 1 comment
Labels
Area: Specification Related to the API spec used to generate client code
Milestone

Comments

@jloisel
Copy link

jloisel commented Jan 25, 2022

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?

@swallez swallez added this to the v7.17.0 milestone Jan 25, 2022
@swallez swallez added the Area: Specification Related to the API spec used to generate client code label Jan 25, 2022
@swallez
Copy link
Member

swallez commented Jan 25, 2022

The upstream API specification has been fixed in elastic/elasticsearch-specification#1326

The next pass of code generation will fix the issue.

swallez added a commit that referenced this issue Jan 25, 2022
swallez added a commit that referenced this issue Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
Development

No branches or pull requests

2 participants