Annotation to handle sanitization of field names in open types
@xuzhg is already working on this.
Since Jun 25, 2024.
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
Assemblies affected
ASP.NET Core OData 8.x
Describe the bug
There is no way to handle special characters if present in dynamic properties in OData, causing:
"The property name '01.01' is invalid; property names must not contain any of the reserved characters ':', '.', '@'."
Reproduce steps
in an IDictionary<string, object>, if the key contains a special character, on read it throws this error
Data Model
class Test {
public string Id{ get; set; }
//extradata
public IDictionary<string, object> ExtraData { get; set; }
}
EDM (CSDL) Model
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="RY.Models">
<EntityType Name="Test" OpenType="true">
<Key>
<PropertyRef Name="Id"/>
</Key>
<Property Name="Id" Type="Edm.String" Nullable="false"/>
</EntityType>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Request/Response
N/A
Expected behavior
There needs to be, for the open type annotation, a way to specify that non-compliant field names must be sanitized before sending them out.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.