Remove _doc wrapper from data stream effective mappings response#8
Open
augment-app-staging[bot] wants to merge 1 commit intomainfrom
Open
Remove _doc wrapper from data stream effective mappings response#8augment-app-staging[bot] wants to merge 1 commit intomainfrom
augment-app-staging[bot] wants to merge 1 commit intomainfrom
Conversation
The GetDataStreamMappingsAction and UpdateDataStreamMappingsAction now strip the _doc type wrapper from the effective_mappings field before returning the response to the client. This makes the API response cleaner and more consistent with the expected output format. Changes: - Modified GetDataStreamMappingsAction.DataStreamMappingsResponse.toXContent() to check for and remove the _doc wrapper from effective_mappings - Modified UpdateDataStreamMappingsAction.DataStreamMappingsResponse.toXContent() to check for and remove the _doc wrapper from effective_mappings - Updated YAML rest tests to assert on effective_mappings.properties instead of effective_mappings._doc.properties - Added unit test to verify _doc wrapper is properly stripped Fixes: https://augment-wic8570.slack.com/archives/C0AG2MXKEQJ/p1772239116870609
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 removes the
_doctype wrapper from theeffective_mappingsfield in data stream mappings API responses. The_docwrapper is an internal implementation detail fromMapperService.SINGLE_MAPPING_NAMEthat should not be exposed to API clients.Changes
GetDataStreamMappingsAction.DataStreamMappingsResponse.toXContent()to strip the_docwrapper fromeffective_mappingsbefore serializationUpdateDataStreamMappingsAction.DataStreamMappingsResponse.toXContent()to strip the_docwrapper fromeffective_mappingsbefore serialization250_data_stream_mappings.ymlto assert oneffective_mappings.propertiesinstead ofeffective_mappings._doc.propertiestestResponseToXContentStripsDocWrapper()to verify the_docwrapper is properly strippedTesting
Related
Note: This PR was automatically created by Augment Agent. Please review carefully before merging.