From aa9aedac6b78a42f4425c9c3849488abe555e399 Mon Sep 17 00:00:00 2001 From: Aradhya Mahajan <147337970+Aradhya2708@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:43:19 +0530 Subject: [PATCH] Fix non-standard field names in /_recovery API response Updated field names in SnapshotRecoverySource to use snake_case for consistency across API responses: - isSearchableSnapshot -> is_searchable_snapshot - remoteStoreIndexShallowCopy -> remote_store_index_shallow_copy - sourceRemoteStoreRepository -> source_remote_store_repository - sourceRemoteTranslogRepository -> source_remote_translog_repository This change aligns with OpenSearch API naming conventions. Signed-off-by: Aradhya Mahajan <147337970+Aradhya2708@users.noreply.github.com> --- .../org/opensearch/cluster/routing/RecoverySource.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java b/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java index ae96ea6b73cca..bc5c8fa230894 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java +++ b/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java @@ -415,10 +415,10 @@ public void addAdditionalFields(XContentBuilder builder, ToXContent.Params param .field("version", version.toString()) .field("index", index.getName()) .field("restoreUUID", restoreUUID) - .field("isSearchableSnapshot", isSearchableSnapshot) - .field("remoteStoreIndexShallowCopy", remoteStoreIndexShallowCopy) - .field("sourceRemoteStoreRepository", sourceRemoteStoreRepository) - .field("sourceRemoteTranslogRepository", sourceRemoteTranslogRepository); + .field("is_searchable_snapshot", isSearchableSnapshot) + .field("remote_store_index_shallow_copy", remoteStoreIndexShallowCopy) + .field("source_remote_store_repository", sourceRemoteStoreRepository) + .field("source_remote_translog_repository", sourceRemoteTranslogRepository); } @Override