-
Notifications
You must be signed in to change notification settings - Fork 352
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
Text "Date" will be parsed as "EDM.Date" type segment in URL parser #680
Comments
A simple test case that reproduces the issue: var model = new EdmModel();
var entityType = new EdmEntityType("NS", "Entity");
entityType.AddKeys(entityType.AddStructuralProperty("IdStr", EdmPrimitiveTypeKind.String, false));
var container = new EdmEntityContainer("NS", "Container");
var set = container.AddEntitySet("Set", entityType);
model.AddElements(new IEdmSchemaElement[] { entityType, container });
var svcRoot = new Uri("http://host", UriKind.Absolute);
var parseResult = new ODataUriParser(model, svcRoot, new Uri("http://host/Set/Date", UriKind.Absolute)).ParseUri(); It actually results in an exception
This is exactly because But the real question here is whether this is a bug or expected behavior. According to the spec, string literals are those enclosed within single-quotes. Since you are giving in the key segment the literal value for a string-typed key, It should, in theory, follow the string-literal syntax. Therefore, a correct key-as-segment request URL should be |
This looks like an issue anyway. In the spec, type-cast is associated with qualified type name. A qualified name should contain a namespace part. In other words, |
Short summary (3-5 sentences) describing the issue.
During the parsing of the following URL (KeyAsSegment): "https://localhost/beta/me/EntityA/Date", "Data" will be parsed as type segment, which does not follow the protocol.
Assemblies affected
ODL 6.x and 7.x
Reproduce steps
Parse "https://localhost/beta/me/EntityA/Date" with KeyAsSegment settings.
The type of key in EntityA is string.
Expected result
Date should be a KeySegment.
Actual result
Date is a typesegment.
Additional details
FindDeclaredType in Edm lib will find type "Edm.Data" given "Date"
The text was updated successfully, but these errors were encountered: