Skip to content

[BUG] "shape" should not be required in GeoShapeQueryField #2011

Description

@efreeti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions