We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 575cf31 commit 723c72bCopy full SHA for 723c72b
src/WebApiToTypeScript/Types/TypeService.cs
@@ -10,6 +10,9 @@ namespace WebApiToTypeScript.Types
10
{
11
public class TypeService : ServiceAware
12
13
+ private Regex ValidTypeNameRegex { get; }
14
+ = new Regex("^[a-zA-Z_][a-zA-Z0-9_]*$");
15
+
16
private Dictionary<string, List<Type>> PrimitiveTypesMapping { get; }
17
= new Dictionary<string, List<Type>>();
18
@@ -37,6 +40,11 @@ public string FixIfReservedWord(string word)
37
40
: word;
38
41
}
39
42
43
+ public bool IsValidTypeName(string typeName)
44
+ {
45
+ return ValidTypeNameRegex.IsMatch(typeName);
46
+ }
47
48
public void LoadAllTypes(string webApiModuleFilePath)
49
50
var webApiApplicationModule = ModuleDefinition
0 commit comments