New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UriParser should throw exception for mismatched keys count when UnqualifiedODataUriResolver is configured. #1153

Closed
biaol-odata opened this Issue Apr 21, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@biaol-odata
Member

biaol-odata commented Apr 21, 2018

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.

@biaol-odata

This comment has been minimized.

Member

biaol-odata commented May 18, 2018

Closed as merged.

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