Azure / Azure/azure-rest-api-specs

Inconsistent Error messages for most requests involving x-ms-partitionkey/x-ms-documentdb-partitionkey

Open
#10,174 0 comments 0 reactions 0 assignees View on GitHub
Doc Db needs-team-attention question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

When interacting with endpoints that require a partitionkey to be sent as a header, failure to provide one results in a suggestion to fix the `x-ms-partitionkey` header value and `BadRequest`.

![PartitionKey Error 1](https://user-images.githubusercontent.com/26727346/87702825-8840f380-c75f-11ea-9684-12981083911e.jpg)

In reality, it should suggest fixing the `x-ms-documentdb-partitionkey` as described in [Delete Document](https://docs.microsoft.com/en-us/rest/api/cosmos-db/delete-a-document)

Here is an example of providing a `x-ms-partitionkey` header and receiving a `BadRequest`...
![PartitionKey Error 3](https://user-images.githubusercontent.com/26727346/87703177-0b624980-c760-11ea-9d1a-486c49ebbacf.jpg)

And here is an example of providing a `x-ms-documentdb-partitionkey` header and receiving a Successful Response...
![PartitionKey Error No Content](https://user-images.githubusercontent.com/26727346/87703405-6dbb4a00-c760-11ea-9017-640e60bf8fde.jpg)

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the documented delete-document requests with and without each partition-key header, then trace the Azure REST specification or service entry covering these endpoints. Done means the error identifies x-ms-documentdb-partitionkey consistently and requests using that header continue to succeed.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.