opensearch-project / opensearch-project/opensearch-java
[BUG] "shape" should not be required in GeoShapeQueryField
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 165
- Forks
- 250
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 26
Description
What is the bug?
The current opesearch-openapi.yaml contias following definition:
_common.query_dsl___GeoShapeQueryField:
type: object
properties:
indexed_shape:
$ref: '#/components/schemas/_common.query_dsl___FieldLookup'
shape:
$ref: '#/components/schemas/_common.query_dsl___GeoShape'
relation:
$ref: '#/components/schemas/_common___GeoShapeRelation'
required:
- shape
This is not correct to require "shape", it's not required in the API - https://docs.opensearch.org/latest/query-dsl/geo-and-xy/geoshape/#using-a-pre-indexed-shape-definition
This makes it impossible to do pre-indexed shape queries right now using query DSL generated classes.
How can one reproduce the bug?
new Query.Builder()
.geoShape(GeoShapeQuery.Builder()
.field("some")
.shape(shape -> shape.indexedShape(i -> i.index("some").id("id").path("path")))
.build()
)
.build();
What is the expected behavior?
I expect it to be possible to do pre-indexed shape queries.
What is your host/environment?
Any
Do you have any screenshots?
N/A
Do you have any additional context?
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with opesearch-openapi.yaml and the GeoShapeQuery generated classes used by the Java reproduction. Check how the GeoShapeQueryField schema's required fields become builder validation, then verify that a pre-indexed shape query can be built and serialized without requiring shape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100