Fix: Remove _doc wrapper from effective_mappings in data stream API responses#2
Open
augment-app-staging[bot] wants to merge 1 commit intomainfrom
Open
Fix: Remove _doc wrapper from effective_mappings in data stream API responses#2augment-app-staging[bot] wants to merge 1 commit intomainfrom
augment-app-staging[bot] wants to merge 1 commit intomainfrom
Conversation
…esponses The effective_mappings field in the get data stream API response was incorrectly including a top-level _doc wrapper. This fix strips the _doc wrapper when serializing effective_mappings to match the API spec. Changes: - Updated GetDataStreamMappingsAction.DataStreamMappingsResponse.toXContent() to strip _doc wrapper from effective_mappings before serialization - Updated UpdateDataStreamMappingsAction.DataStreamMappingsResponse.toXContent() to strip _doc wrapper from effective_mappings before serialization - Updated YAML REST tests to expect effective_mappings without _doc wrapper The fix follows the same pattern already used in DataStream.getEffectiveMappings() which strips the _doc wrapper when computing effective mappings. Related: https://augment-wic8570.slack.com/archives/C0AG2MXKEQJ/p1772152555538559
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue where the
effective_mappingsfield in the get data stream API response was incorrectly including a top-level_docwrapper. The API spec indicates that this wrapper should not be present.Base
This PR is based on tag
eval-tag-134005and should be merged into a branch created from that tag.Problem
When the effective mappings are serialized in the API response, they can contain a top-level
_dockey wrapper like{"_doc": {"properties": {...}}}instead of just{"properties": {...}}.The
DataStream.getEffectiveMappings()static method already has logic to strip the_docwrapper when computing effective mappings, but thetoXContentmethods that serialize the response were not stripping this wrapper.Changes
DataStreamMappingsResponse.toXContent()to strip the_docwrapper fromeffective_mappingsbefore serializationDataStreamMappingsResponse.toXContent()to strip the_docwrapper fromeffective_mappingsbefore serializationeffective_mappingswithout the_docwrapperTesting
GetDataStreamMappingsActionTestsUpdateDataStreamMappingsActionResponseTests250_data_stream_mappingsRelated
Note: This PR was created by Augment Agent and should be reviewed before merging.