fix: allow indexed_shape-only geo/xy shape queries - #2088
Open
arimu1 wants to merge 2 commits into
Open
Conversation
The OpenSearch geo_shape / xy_shape APIs allow either an inline shape or a pre-indexed shape via indexed_shape. Requiring shape in the OpenAPI schema and generated builders made indexed_shape-only queries impossible. Remove shape from required in the local OpenAPI copy and update the generated models so shape is nullable, matching indexed_shape. Fixes opensearch-project#2011 Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
arimu1
requested review from
Bukhtawar,
VachaShah,
Xtansia,
madhusudhankonda,
reta,
saratvemulapalli and
szczepanczykd
as code owners
August 7, 2026 16:31
Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
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.
Description
Fixes #2011.
GeoShapeQueryField(and the siblingXyShapeQueryField) currently markshapeas required. OpenSearch documents that a geo/xy shape query may use either an inlineshapeor a pre-indexed shape viaindexed_shape(not both). Because the generated builder enforcesshape, callers cannot construct valid pre-indexed shape queries:Changes
required: [shape]from_common.query_dsl___GeoShapeQueryFieldand_common.query_dsl___XyShapeQueryFieldinjava-codegen/opensearch-openapi.yamlGeoShapeQueryField/XyShapeQueryFieldsoshapeis@Nullable(noApiTypeHelper.requireNonNull, conditional serialization, null-safe equals/hashCode)indexed_shape-only construction/serializationRelated
shapeshould not be required inGeoShapeQueryField(blocks pre-indexed shape queries in generated clients) opensearch-api-specification#1160 / Fix copy-paste mistake in NeuralSearch sample #1161 (same schema correction). This client PR unblocks users of the generated DSL until the next full spec refresh.Testing
Temurin 21 / macOS — 4 tests, 0 failures (
toBuilder+indexedShapeOnlyfor both classes).Check List
Signed-off-byBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.