Skip to content

Commit 70d6cbf

Browse files
committed
2 parents d965b9c + 5399f6e commit 70d6cbf

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

src/GraphODataTemplateWriter/CodeHelpers/Java/TypeHelperJava.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public static string CreatePackageDefForEnum(this CustomT4Host host)
754754
}
755755
public static string GetPackagePrefix(this OdcmObject obj)
756756
{
757-
switch(obj)
757+
switch (obj)
758758
{
759759
case OdcmEnum e:
760760
return "models.generated";
@@ -860,7 +860,7 @@ public static string CreatePackageDefForBaseMethodRequestBuilder(this CustomT4Ho
860860
sb.Append("\n");
861861

862862
var imports = host.CurrentType.AsOdcmMethod().WithOverloads().SelectMany(x => ImportClassesOfMethodParameters(x));
863-
sb.Append(imports.Any() ? imports.Aggregate((x, y) => $"{x}{Environment.NewLine}{y}"): string.Empty);
863+
sb.Append(imports.Any() ? imports.Aggregate((x, y) => $"{x}{Environment.NewLine}{y}") : string.Empty);
864864
return sb.ToString();
865865
}
866866

@@ -1463,14 +1463,15 @@ public static string CreatePropertyDef(IEnumerable<OdcmProperty> properties, boo
14631463
var propertyFormat = format;
14641464
if (property.IsCollection)
14651465
{
1466-
if (!property.IsNavigation())
1466+
if (property.IsNavigation())
14671467
{
1468-
propertyType = "java.util.List<" + property.GetTypeString() + ">";
1468+
propertyType = TypeCollectionPage(property);
1469+
if (!property.ContainsTarget)
1470+
propertyFormat = collectionFormat;
14691471
}
14701472
else
14711473
{
1472-
propertyType = TypeCollectionPage(property);
1473-
propertyFormat = collectionFormat;
1474+
propertyType = "java.util.List<" + property.GetTypeString() + ">";
14741475
}
14751476
}
14761477
else

test/Typewriter.Test/TestDataJava/com/microsoft/graph/models/extensions/CloudCommunications.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ public class CloudCommunications extends Entity implements IJsonBackedObject {
3636
* The Calls.
3737
*
3838
*/
39+
@SerializedName("calls")
40+
@Expose
3941
public CallCollectionPage calls;
4042

4143
/**
4244
* The Call Records.
4345
*
4446
*/
47+
@SerializedName("callRecords")
48+
@Expose
4549
public CallRecordCollectionPage callRecords;
4650

4751

test/Typewriter.Test/TestDataJava/com/microsoft/graph/models/extensions/Schedule.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ public class Schedule extends Entity implements IJsonBackedObject {
4444
* The Times Off.
4545
*
4646
*/
47+
@SerializedName("timesOff")
48+
@Expose
4749
public TimeOffCollectionPage timesOff;
4850

4951
/**
5052
* The Time Off Requests.
5153
*
5254
*/
55+
@SerializedName("timeOffRequests")
56+
@Expose
5357
public TimeOffRequestCollectionPage timeOffRequests;
5458

5559

test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/models/extensions/CallRecord.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,16 @@ public class CallRecord extends Entity implements IJsonBackedObject {
111111
* The Sessions.
112112
*
113113
*/
114+
@SerializedName("sessions")
115+
@Expose
114116
public SessionCollectionPage sessions;
115117

116118
/**
117119
* The Recipients.
118120
*
119121
*/
122+
@SerializedName("recipients")
123+
@Expose
120124
public EntityType2CollectionPage recipients;
121125

122126

test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/models/extensions/Session.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public class Session extends Entity implements IJsonBackedObject {
8484
* The Segments.
8585
*
8686
*/
87+
@SerializedName("segments")
88+
@Expose
8789
public SegmentCollectionPage segments;
8890

8991

0 commit comments

Comments
 (0)