UriParser should throw exception for mismatched keys count (extraneous) when UnqualifiedODataUriResolver is configured.
Sample case:
With the following EDM model:
var pet = new EdmEntityType("TestNS", "Pet");
PetType = pet;
model.AddElement(pet);
var key1 = pet.AddStructuralProperty("key1", EdmCoreModel.Instance.GetInt32(false));
var key2 = pet.AddStructuralProperty("key2", EdmCoreModel.Instance.GetString(false));
pet.AddKeys(key1, key2);
var petSet = container.AddEntitySet("PetSet", pet);
and the following relative uri:
"PetSet(key1=1, key2='aStr', nonExistingKey='bStr')"
ODataUriParser instance configured with UnqualifiedODataUriResolver should throw exception for mismatched key count during uri parsing.
Note the default ODataUriParser instance configured with default ODataUriResolver does throw exception as expected. Therefore, the difference is caused by the different types of Uri resolver configured.
Assemblies affected
OData .Net lib < 7.4.4.
Reproduce steps
See description above.
Expected result
ODataException thrown for mismatched keys count.
Actual result
*No exception thrown. Extraneous keys are ignored. *
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.
UriParser should throw exception for mismatched keys count (extraneous) when UnqualifiedODataUriResolver is configured.
Sample case:
With the following EDM model:
and the following relative uri:
"PetSet(key1=1, key2='aStr', nonExistingKey='bStr')"ODataUriParser instance configured with UnqualifiedODataUriResolver should throw exception for mismatched key count during uri parsing.
Note the default ODataUriParser instance configured with default ODataUriResolver does throw exception as expected. Therefore, the difference is caused by the different types of Uri resolver configured.
Assemblies affected
OData .Net lib < 7.4.4.
Reproduce steps
See description above.
Expected result
ODataException thrown for mismatched keys count.
Actual result
*No exception thrown. Extraneous keys are ignored. *
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.