Skip to content

Commit

Permalink
Fix non-standard field names in /_recovery API response
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Aradhya2708 authored Nov 1, 2024
1 parent 0363aa7 commit aa9aeda
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 421 in server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java

View check run for this annotation

Codecov / codecov/patch

server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java#L418-L421

Added lines #L418 - L421 were not covered by tests
}

@Override
Expand Down

0 comments on commit aa9aeda

Please sign in to comment.