Validate data-partition-id in PartitionServiceClient
All Submissions:
- [YES/NO] I have added an explanation of what changes in this merge do and why we should include it?
- [YES/NO] I have updated the documentation accordingly.
- [YES/NO/NA] I have added tests to cover my changes.
- [YES/NO/NA] All new and existing tests passed.
- [YES/NO/NA] My code follows the code style of this project.
- [YES/NO/NA] I ran lint checks locally prior to submission.
What is the issue or story related to the change?
Today we do not validate the data-partition-id because of which inbuilt URI class throws Illegal Argument Exception if an invalid data-partition-id is passed in headers.
For example, if a char {
is passed into data-partition-id then Illegal Argument Exception is thrown which is ultimately converted into 500 error response by service. Ideally a 4XX response should have been returned.
This PR introduces a validation on data-partition-id which will help in responding back with 4XX response instead of 500.
High level design:
Issue:
Change details:
Test coverage:
Does this introduce a breaking change?
- [YES/NO]
Pending items
Reviewer request
- Please provide an ETA when you plan to review this MR. Write a comment to decline or provide an ETA.
- Block the MR if you feel there is less testing or no details in the MR
- Please cover the following aspects in the MR -- Coding design: <Reviewer1> -- Backward Compatibility: <Reviewer2> -- Feature Logic: <Logic design> -- <Any other context mention here> OR -- <Component 1>: <Reviewer1> -- <CosmosDB>: <Reviewer2> -- <ServiceBus> <Reviewer3> -- <Mention any other component and owner>