Skip to content

Commit be596d0

Browse files
committed
Fix nodes API compatibility with OpenSearch 3.1.0+ search pipelines
OpenSearch 3.1.0 introduced a new phase_results_processors field in the search_pipelines section of the nodes info API response. The Go client's NodesInfoSearchPipelines struct was missing this field, causing it to be dropped during JSON marshalling/unmarshalling. This resulted in test failures when comparing raw JSON with parsed JSON. Add PhaseResultsProcessors field with omitempty tag to maintain backward compatibility with older OpenSearch versions that don't have this field. Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>
1 parent d85792a commit be596d0

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1414
### Removed
1515

1616
### Fixed
17+
- Fix nodes API compatibility with OpenSearch 3.1.0+ by adding phase_results_processors field
1718

1819
### Security
1920

opensearchapi/api_nodes-info.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,10 @@ type NodesInfoAgg struct {
187187

188188
// NodesInfoSearchPipelines is a sub type of NodesInfo containing information about search pipelines
189189
type NodesInfoSearchPipelines struct {
190-
RequestProcessors []NodesInfoType `json:"request_processors"`
191-
ResponseProcessors []NodesInfoType `json:"response_processors"`
192-
Processors []NodesInfoType `json:"processors,omitempty"` // Deprecated field only available in 2.7.0
190+
RequestProcessors []NodesInfoType `json:"request_processors"`
191+
ResponseProcessors []NodesInfoType `json:"response_processors"`
192+
PhaseResultsProcessors []NodesInfoType `json:"phase_results_processors,omitempty"` // Available in OpenSearch 3.1.0+
193+
Processors []NodesInfoType `json:"processors,omitempty"` // Deprecated field only available in 2.7.0
193194
}
194195

195196
// NodesInfoType is a sub type of NodesInfoIngest, NodesInfoSearchPipelines containing information about a type

0 commit comments

Comments
 (0)