Skip to content

[FEATURE REQ] | Runtime error advice when unique key annotation is not properly initialized. #35275

Open
@rishi2758

Description

Is your feature request related to a problem? Please describe.
While working with cosmos dB java sdk, I faced an issue where I was trying to setup, Unique Key using @CosmosUniqueKey and @CosmosUniqueKeyPolicy annotations, but struggled for quite a while later i saw while searching over GitHub that in Readme.md examples does exists.

Describe the solution you'd like
I was thinking to improve this annotation configuration by raising the exception if user has incorrectly configured the annotations.
or may be ensure the type safety by specifying what is expected as an argument in @CosmosUniqueKeyPolicy.

Describe alternatives you've considered
None, it's just that if we can improve this i think others can benefit such that if they incorrectly configured the annotations, they might know at runtime or compile time.
As i was clueless why this was not working when i configured @CosmosUniqueKey and @CosmosUniqueKeyPolicy separately over the entity class.

Additional context
We can make changes here, if you want i can quickly raise the PR for this change

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Cosmoscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions