Skip to content

Remove redundant type:object declarations for non-SingleBucketAggregateBase Aggregator types, and add properties: {} for SingleBucketAggregateBase types#1083

Draft
karenyrx wants to merge 2 commits intoopensearch-project:mainfrom
karenyrx:typeobj
Draft

Remove redundant type:object declarations for non-SingleBucketAggregateBase Aggregator types, and add properties: {} for SingleBucketAggregateBase types#1083
karenyrx wants to merge 2 commits intoopensearch-project:mainfrom
karenyrx:typeobj

Conversation

@karenyrx
Copy link
Copy Markdown
Collaborator

@karenyrx karenyrx commented Mar 26, 2026

Description

Remove redundant type:object declarations for all *Aggregate types, not just the types fixed in in https://github.com/opensearch-project/opensearch-api-specification/pull/1063/changes

For single bucket aggregates (8 total), keep '- type: object' with explicit 'properties: {}' for clarity. This ensures proper additionalProperties inheritance from SingleBucketAggregateBase while being explicit that no NEW properties are added. Without the 'type: object + properties: {}', some validators don't properly merge additionalProperties from the base schema.

    FilterAggregate:
      allOf:
        - $ref: '#/components/schemas/SingleBucketAggregateBase'
        - type: object
          properties: {}  # Explicit: no new properties beyond base

This pattern:

  • Inherits doc_count from SingleBucketAggregateBase
  • Inherits additionalProperties (for sub-aggregations) from the base
  • Does NOT allow arbitrary new properties (properties: {} makes this clear)
  • Fixes validation errors for sub-aggregations like 'cities'

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.

@github-actions
Copy link
Copy Markdown
Contributor

Proto Compatibility Report

Merge Report

No changes detected.


Generated by Proto Compatibility Check

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Changes Analysis

Commit SHA: a8aa1b4
Comparing To SHA: b3dea31

API Changes

Summary

└─┬Components
  └─┬Schemas
    ├─┬_common.aggregations___SingleBucketAggregateBase
    │ ├──[➖] additionalProperties (44355:9)❌ 
    │ ├──[➖] required (44353:11)❌ 
    │ ├──[➖] type (44346:5)
    │ ├──[➖] properties/doc_count (44349:9)❌ 
    │ ├──[➕] allOf (41628:7)
    │ └──[➕] allOf (44334:11)
    ├─┬_common.aggregations___DateHistogramAggregate
    │ └──[➖] allOf (42420:11)❌ 
    ├─┬_common.aggregations___SumAggregate
    │ └──[➖] allOf (44520:11)❌ 
    ├─┬_common.aggregations___MaxAggregate
    │ └──[➖] allOf (43306:11)❌ 
    ├─┬_common.aggregations___ExtendedStatsBucketAggregate
    │ └──[➖] allOf (42712:11)❌ 
    ├─┬_common.aggregations___SimpleValueAggregate
    │ └──[➖] allOf (44345:11)❌ 
    ├─┬_common.aggregations___MedianAbsoluteDeviationAggregate
    │ └──[➖] allOf (43321:11)❌ 
    ├─┬_common.aggregations___HdrPercentilesAggregate
    │ └──[➖] allOf (42981:11)❌ 
    ├─┬_common.aggregations___SignificantLongTermsAggregate
    │ └──[➖] allOf (44119:11)❌ 
    ├─┬_common.aggregations___TDigestPercentileRanksAggregate
    │ └──[➖] allOf (44543:11)❌ 
    ├─┬_common.aggregations___MinAggregate
    │ └──[➖] allOf (43349:11)❌ 
    ├─┬_common.aggregations___ValueCountAggregate
    │ └──[➖] allOf (44879:11)❌ 
    ├─┬_common.aggregations___DateRangeAggregate
    │ └──[➖] allOf (42486:11)❌ 
    ├─┬_common.aggregations___IpRangeAggregate
    │ └──[➖] allOf (43123:11)❌ 
    ├─┬_common.aggregations___TDigestPercentilesAggregate
    │ └──[➖] allOf (44547:11)❌ 
    ├─┬_common.aggregations___AdjacencyMatrixAggregate
    │ └──[➖] allOf (41470:11)❌ 
    ├─┬_common.aggregations___StatsBucketAggregate
    │ └──[➖] allOf (44484:11)❌ 
    ├─┬_common.aggregations___RangeAggregate
    │ └──[➖] allOf (43918:11)❌ 
    ├─┬_common.aggregations___HdrPercentileRanksAggregate
    │ └──[➖] allOf (42977:11)❌ 
    ├─┬_common.aggregations___FiltersAggregate
    │ └──[➖] allOf (42752:11)❌ 
    ├─┬_common.aggregations___SignificantStringTermsAggregate
    │ └──[➖] allOf (44135:11)❌ 
    ├─┬_common.aggregations___WeightedAvgAggregate
    │ └──[➖] allOf (44978:11)❌ 
    ├─┬_common.aggregations___VariableWidthHistogramAggregate
    │ └──[➖] allOf (44906:11)❌ 
    ├─┬_common.aggregations___HistogramAggregate
    │ └──[➖] allOf (42985:11)❌ 
    ├─┬_common.aggregations___AvgAggregate
    │ └──[➖] allOf (42010:11)❌ 
    ├─┬_common.aggregations___GeoDistanceAggregate
    │ └──[➖] allOf (42838:11)❌ 
    ├─┬_common.aggregations___GeoTileGridAggregate
    │ └──[➖] allOf (42908:11)❌ 
    ├─┬_common.aggregations___GeoHashGridAggregate
    │ └──[➖] allOf (42867:11)❌ 
    ├─┬_common.aggregations___PercentilesBucketAggregate
    │ └──[➖] allOf (43891:11)❌ 
    ├─┬_common.aggregations___MultiTermsAggregate
    │ └──[➖] allOf (43708:11)❌ 
    └─┬_common.aggregations___UnmappedSignificantTermsAggregate
      └──[➖] allOf (44835:11)❌ 

Document Element Total Changes Breaking Changes
components 36 33
  • BREAKING Changes: 33 out of 36
  • Removals: 34
  • Additions: 2
  • Breaking Removals: 33

Report

The full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/23814716434/artifacts/6206759857

API Coverage

Before After Δ
Covered (%) 666 (65.23 %) 666 (65.23 %) 0 (0 %)
Uncovered (%) 355 (34.77 %) 355 (34.77 %) 0 (0 %)
Unknown 149 149 0

@karenyrx karenyrx force-pushed the typeobj branch 8 times, most recently from 58bc774 to 8f31110 Compare March 29, 2026 22:56
… properties: {} for SingleBucketAggregators

Signed-off-by: Karen X <karenxyr@gmail.com>
@karenyrx karenyrx changed the title Remove redundant type:object declarations for Aggregate types Remove redundant type:object declarations for non-SingleBucketAggregateBase Aggregator types, and add properties: {} for SingleBucketAggregateBase types Mar 29, 2026
Signed-off-by: Karen X <karenxyr@gmail.com>
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.

1 participant