Skip to content

Fix simplifySingleMapSchema to generate named wrapper schemas#406

Merged
lucy66hw merged 3 commits intoopensearch-project:mainfrom
lucy66hw:simplify_map_with_one
Mar 2, 2026
Merged

Fix simplifySingleMapSchema to generate named wrapper schemas#406
lucy66hw merged 3 commits intoopensearch-project:mainfrom
lucy66hw:simplify_map_with_one

Conversation

@lucy66hw
Copy link
Collaborator

@lucy66hw lucy66hw commented Feb 27, 2026

Description

Rewrote simplifySingleMapSchema to create a { field: string, <type_name>: <value_schema> } wrapper instead of reconstructing/merging additional property definitions
Removed removeArrayOfMapWrapper (and its call sites) — array-of-map unwrapping no longer needed

###Test

message TermsAggregation {
  repeated SortOrderSingleMap order = 12;
}
message SortOrderSingleMap {

  // The path to a field or an array of paths. Some APIs support wildcards in the path, which allows you to select multiple fields.
  string field = 1;

  SortOrder sort_order = 2;
}

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 96.07843% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.10%. Comparing base (04857cc) to head (f6ab1ee).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
tools/proto-convert/src/SchemaModifier.ts 95.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #406      +/-   ##
==========================================
+ Coverage   91.86%   95.10%   +3.24%     
==========================================
  Files          15       15              
  Lines        1364     1389      +25     
  Branches      369      382      +13     
==========================================
+ Hits         1253     1321      +68     
+ Misses        110       62      -48     
- Partials        1        6       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucy66hw lucy66hw force-pushed the simplify_map_with_one branch from 8ff07a2 to afebc19 Compare February 27, 2026 06:40
Signed-off-by: xil <fridalu66@gmail.com>
@lucy66hw lucy66hw force-pushed the simplify_map_with_one branch from afebc19 to 2ffa4c7 Compare March 2, 2026 00:43
Signed-off-by: xil <fridalu66@gmail.com>
@lucy66hw lucy66hw force-pushed the simplify_map_with_one branch from afc0e9b to 75d5467 Compare March 2, 2026 03:05
Signed-off-by: xil <fridalu66@gmail.com>
@lucy66hw lucy66hw marked this pull request as ready for review March 2, 2026 22:43
@lucy66hw lucy66hw merged commit 8169480 into opensearch-project:main Mar 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants