Skip to content

Commit 8da1cbf

Browse files
committed
TypeScript long descriptions and fixed array notation
1 parent 9537e7e commit 8da1cbf

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Templates/TypeScript/src/entity_types.ts.tt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ export type <#= enumType.Name.UpperCaseFirstChar() #> = <#= enumType.GetEnumValu
2828
#>
2929

3030
export interface <#= entityType.Name.UpperCaseFirstChar() #><# if (entityType.Base != null) { #> extends <#= entityType.Base.Name.UpperCaseFirstChar() #><# }#> {
31+
3132
<# foreach(var prop in entityType.Properties.ToList()) { #>
33+
<# if (prop.LongDescription != null) { #>
34+
/** <#=prop.LongDescription#> */
35+
<# } #>
3236
<#= prop.Name #>?: <#= prop.GetTypeString() #>
37+
3338
<# } #>
3439
}
3540
<#
@@ -39,10 +44,14 @@ export interface <#= entityType.Name.UpperCaseFirstChar() #><# if (entityType.Ba
3944
foreach(var complexType in complexTypes)
4045
{
4146
#>
42-
4347
export interface <#= complexType.Name.UpperCaseFirstChar()#><# if (complexType.Base != null) { #> extends <#= complexType.Base.Name.UpperCaseFirstChar() #><# }#> {
48+
4449
<# foreach(var prop in complexType.Properties) { #>
45-
<#= prop.Name #>?: <#= prop.GetTypeString() #>
50+
<# if (prop.LongDescription != null) { #>
51+
/** <#=prop.LongDescription#> */
52+
<# } #>
53+
<#= prop.Name #>?: <#= prop.GetTypeString() #>
54+
4655
<# } #>
4756
}
4857
<# } #>

src/GraphODataTemplateWriter/CodeHelpers/TypeScript/TypeHelperTypeScript.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static string GetTypeString(this OdcmProperty prop)
5252
break;
5353

5454
}
55-
return (prop.IsCollection) ? "[" + typeStr + "]" : typeStr;
55+
return (prop.IsCollection) ? typeStr + "[]" : typeStr;
5656

5757
}
5858
public static String UpperCaseFirstChar(this String s)

0 commit comments

Comments
 (0)