You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code does not do any sanitizing on Edm metadata before writing it into generated identifiers, specifically IEdmNamedElement.Name is only "fixed" if it matches a target language reserved word verbatim, unless it is massaged anyway (e.g. prefixing "_" for a backing field name). Except if this.context.EnableNamingAlias is on, in which case it's passed through Customization.CustomizeNaming.
I have no idea how to turn on EnableNamingAlias or provide a CustomizeNaming implementation to sanitize Edm names to valid identifier names in the GUI, I suspect that's not what it's for.
So I suggest creating a sanitizing function that reduces an arbitrary string to a valid target language identifier and call it in the vicinity of all ~40 references to CustomizeNaming, even on the output of CustomizeNaming. Might get tricky if the Name in question does not contain any character valid in identifiers and the language does not offer identifer escaping... (like [arbitrary field name] in SQL or `...funny name 😂...` in kotlin or...).
Describe the bug
When generating the C# classes, I get a few invalid names like
MxnConfValCopyValues$
. The$
isn't a valid character for a class name.Version of the Project affected
ODataConnectedService v0.12.1
VisualStudio Version v16.8.4
Microsoft.Odata.Client v7.9.0
To Reproduce
Create an odata service with a
$
in the name of a typeand then a function like this:
Expected behavior
A working class
Actual behavior
An invalid class and code that doesn't compile.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: