opensearch-project / opensearch-project/opensearch-java
[BUG] invalid `dynamic_template` (includes auto-generated `"type": "object"`)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 165
- Forks
- 250
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 26
Description
see https://github.com/opensearch-project/spring-data-opensearch/issues/437
this seems to come from this client
What is the bug?
using dynamic_template generates a wrong template (it includes "type": "object") which then leads to wrong behaviour when ingesting field names with dots in it.
the problem seems to come from here:
https://github.com/opensearch-project/opensearch-java/blob/61567fa5b67ab62880a5f503b5cf1bcea31af562/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/Property.java#L1440
which was previously here (got moved around in a recent re-generation):
https://github.com/opensearch-project/opensearch-java/blob/39552405c07a685fa4d0c29995895439db1d2682/java-client/src/main/java/org/opensearch/client/opensearch/_types/mapping/Property.java#L1494
How can one reproduce the bug?
see https://github.com/opensearch-project/spring-data-opensearch/issues/437
What is the expected behavior?
the provided example works both with the old and new client. more concretely: opensearch-java mustn't inject "type": "object" into the dynamic_template
What is your host/environment?
n/a
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 in java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/Property.java around the dynamic_template handling at the referenced line, comparing it with the previous location. Reproduce the example from spring-data-opensearch issue 437 and inspect the generated template. Done means opensearch-java no longer injects "type": "object" into dynamic_template.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100