opensearch-project / opensearch-project/opensearch-java
[BUG] Inconsistent priority field type between PutIndexTemplateRequest and IndexTemplate models
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 165
- Forks
- 250
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 26
Description
Hi,
I have observed a type inconsistency in the Java client related to the priority field when working with index templates. I am using the 2.9.0 client version, and I see the issue is still present in the latest version.
Details:
- PutIndexTemplateRequest (org.opensearch.client.opensearch.indices.PutIndexTemplateRequest): the priority field is of type Integer
- IndexTemplate (org.opensearch.client.opensearch.indices.get_index_template.IndexTemplate): The priority field is of type Long
Issue:
OpenSearch itself supports a 64-bit integer (int64) for the index template priority, but the Java client's PutIndexTemplateRequest only allows an Integer. This mismatch does not allow creating index templates with values above Integer.MAX_VALUE using the Java client.
Expected Behavior:
Both PutIndexTemplateRequest and IndexTemplate should use Long for the priority field to align with OpenSearch's API.
Thanks!
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
Compare the priority declarations in java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java and java-client/src/generated/java/org/opensearch/client/opensearch/indices/get_index_template/IndexTemplate.java. Confirm that both represent the OpenSearch int64 priority consistently and that the request can accept values above Integer.MAX_VALUE; the issue is done when the client types align.
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
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100