Skip to content

Commit ba9c0a5

Browse files
author
Caitlin Bales (MSFT)
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into cbales-working
2 parents bd69ebe + 7042720 commit ba9c0a5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Templates/TypeScript/src/entity_types.ts.tt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<#= writer.WriteHeader() #>
1818

19+
export as namespace microsoftgraph;
1920

2021
<# foreach(var enumType in enumTypes) { #>
2122
export type <#= enumType.Name.UpperCaseFirstChar() #> = <#= enumType.GetEnumValues() #>
@@ -39,7 +40,7 @@ export interface <#= entityType.Name.UpperCaseFirstChar() #><# if (entityType.Ba
3940
{
4041
#>
4142

42-
export interface <#= complexType.Name.UpperCaseFirstChar()#> {
43+
export interface <#= complexType.Name.UpperCaseFirstChar()#><# if (complexType.Base != null) { #> extends <#= complexType.Base.Name.UpperCaseFirstChar() #><# }#> {
4344
<# foreach(var prop in complexType.Properties) { #>
4445
<#= prop.Name #>?: <#= prop.GetTypeString() #>
4546
<# } #>

src/GraphODataTemplateWriter/CodeHelpers/TypeScript/TypeHelperTypeScript.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ public static string GetTypeString(this OdcmProperty prop)
2929
case "Int32":
3030
case "Int64":
3131
case "Double":
32+
case "Single":
3233
case "Binary": // let binary: number = 0b1010;
33-
case "Duration": //Edm.Duration
3434
typeStr = "number";
3535
break;
3636
case "Guid":
37+
case "Duration":
3738
case "String":
3839
typeStr = "string"; //lowercase
3940
break;
@@ -46,6 +47,9 @@ public static string GetTypeString(this OdcmProperty prop)
4647
case "Boolean":
4748
typeStr = "boolean";
4849
break;
50+
case "Byte": //https://graph.microsoft.io/en-us/docs/api-reference/beta/resources/intune_onboarding_rgbcolor
51+
typeStr = "number";
52+
break;
4953

5054
}
5155
return (prop.IsCollection) ? "[" + typeStr + "]" : typeStr;
@@ -58,4 +62,4 @@ public static String UpperCaseFirstChar(this String s)
5862

5963

6064
}
61-
}
65+
}

0 commit comments

Comments
 (0)