bugfix/missing collection serialization by baywet · Pull Request #285 · microsoftgraph/MSGraph-SDK-Code-Generator
Expand Up
@@ -754,7 +754,7 @@ public static string CreatePackageDefForEnum(this CustomT4Host host)
}
public static string GetPackagePrefix(this OdcmObject obj)
{
switch(obj)
switch (obj)
{
case OdcmEnum e:
return "models.generated";
Expand Down
Expand Up
@@ -860,7 +860,7 @@ public static string CreatePackageDefForBaseMethodRequestBuilder(this CustomT4Ho
sb.Append("\n");
var imports = host.CurrentType.AsOdcmMethod().WithOverloads().SelectMany(x => ImportClassesOfMethodParameters(x)); sb.Append(imports.Any() ? imports.Aggregate((x, y) => $"{x}{Environment.NewLine}{y}"): string.Empty); sb.Append(imports.Any() ? imports.Aggregate((x, y) => $"{x}{Environment.NewLine}{y}") : string.Empty); return sb.ToString(); }
Expand Down Expand Up @@ -1463,14 +1463,15 @@ public static string CreatePropertyDef(IEnumerable<OdcmProperty> properties, boo var propertyFormat = format; if (property.IsCollection) { if (!property.IsNavigation()) if (property.IsNavigation()) { propertyType = "java.util.List<" + property.GetTypeString() + ">"; propertyType = TypeCollectionPage(property); if (!property.ContainsTarget) propertyFormat = collectionFormat; } else { propertyType = TypeCollectionPage(property); propertyFormat = collectionFormat; propertyType = "java.util.List<" + property.GetTypeString() + ">"; } } else Expand Down
var imports = host.CurrentType.AsOdcmMethod().WithOverloads().SelectMany(x => ImportClassesOfMethodParameters(x)); sb.Append(imports.Any() ? imports.Aggregate((x, y) => $"{x}{Environment.NewLine}{y}"): string.Empty); sb.Append(imports.Any() ? imports.Aggregate((x, y) => $"{x}{Environment.NewLine}{y}") : string.Empty); return sb.ToString(); }
Expand Down Expand Up @@ -1463,14 +1463,15 @@ public static string CreatePropertyDef(IEnumerable<OdcmProperty> properties, boo var propertyFormat = format; if (property.IsCollection) { if (!property.IsNavigation()) if (property.IsNavigation()) { propertyType = "java.util.List<" + property.GetTypeString() + ">"; propertyType = TypeCollectionPage(property); if (!property.ContainsTarget) propertyFormat = collectionFormat; } else { propertyType = TypeCollectionPage(property); propertyFormat = collectionFormat; propertyType = "java.util.List<" + property.GetTypeString() + ">"; } } else Expand Down