Skip to content

MissingRequiredPropertyException - Missing required property 'RestoreResponse.snapshot'Β #423

@safebees

Description

@safebees

Java API client version

8.4.3 / 8.2.3

Java version

11

Elasticsearch Version

8.2.3

Problem description

In case a client.snapshot().restore is done then always a MissingRequiredPropertyException
is thrown with the message Missing required property 'RestoreResponse.snapshot'.
The snapshot in the response is checked in constructor of RestoreResponse against requireNonNull.

    RestoreRequest request = new RestoreRequest.Builder().repository("SNAPSHOT_REPO").snapshot(snapshotName)
        .indices(indexNames)
        .waitForCompletion(false)
        .renamePattern("(.+)_index_(.+)")
        .renameReplacement("$1" + indexSuffix)
        .build();
    client.snapshot().restore(request);
co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'RestoreResponse.snapshot'
	at co.elastic.clients.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:76)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse.<init>(RestoreResponse.java:57)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse.<init>(RestoreResponse.java:50)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse$Builder.build(RestoreResponse.java:131)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse$Builder.build(RestoreResponse.java:99)
	at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:80)
	at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
	at co.elastic.clients.transport.rest_client.RestClientTransport.decodeResponse(RestClientTransport.java:328)
	at co.elastic.clients.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:294)
	at co.elastic.clients.transport.rest_client.RestClientTransport.performRequest(RestClientTransport.java:147)
	at co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotClient.restore(ElasticsearchSnapshotClient.java:361)

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions