Merge remote-tracking branch 'origin/v13/dev' into v13/dev

This commit is contained in:
Bjarke Berg
2023-02-08 12:55:31 +01:00
2 changed files with 963 additions and 926 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,14 @@ internal static class SchemaIdGenerator
if (type.IsGenericType)
{
// append the generic type names, ultimately turning i.e. "PagedViewModel<RelationItemViewModel>" into "PagedRelationItem"
name += string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName));
name = $"{name}{string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName))}";
}
if (name.EndsWith("Model") == false)
{
// because some models names clash with common classes in TypeScript (i.e. Document),
// we need to add a "Model" postfix to all models
name = $"{name}Model";
}
// make absolutely sure we don't pass any invalid named by removing all non-word chars