Skip to content

Commit 36ad51b

Browse files
author
Brian Melton
committed
Adding @expose annotations to Entities
1 parent 267f768 commit 36ad51b

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

Templates/Android/BaseModel.template.tt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ public {1} {2}{3}{4} {{";
622622
* The {0}.
623623
*/
624624
@SerializedName(""{1}"")
625+
@Expose
625626
public {2} {3};
626627

627628
";
@@ -673,6 +674,7 @@ public {1} {2}{3}{4} {{";
673674
* The {0}.
674675
*/
675676
@SerializedName(""{1}"")
677+
@Expose
676678
public {2} {3};
677679

678680
";

Templates/Android/generated/BaseEntity.java.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import com.google.gson.annotations.*;
1414
if(((OdcmClass)c).Base == null){
1515
#>
1616
@SerializedName("@odata.type")
17+
@Expose(serialize = false)
1718
public String oDataType;
1819
<#
1920
}

Templates/Android/generated/BaseEntityCollectionResponse.java.tt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ import com.google.gson.annotations.*;
1616
* The list of <#=TypeName(c)#> within this collection page
1717
*/
1818
@SerializedName("value")
19+
@Expose
1920
public List<<#=TypeName(c)#>> value;
2021

2122
/**
2223
* The url to the next page of this collection, or null
2324
*/
2425
@SerializedName("@odata.nextLink")
26+
@Expose(serialize = false)
2527
public String nextLink;
2628

2729
<#=CreateRawJsonObject()#>

Templates/Android/generated/BaseMethodCollectionResponse.java.tt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import com.google.gson.annotations.*;
1313
<#=CreateClassDef(BaseTypeCollectionResponse(c), null, "IJsonBackedObject")#>
1414

1515
@SerializedName("value")
16+
@Expose
1617
public List<<#=OdcmMethodReturnType(c as OdcmMethod)#>> value;
1718

1819
@SerializedName("@odata.nextLink")
20+
@Expose(serialize = false)
1921
public String nextLink;
2022

2123
<#=CreateRawJsonObject()#>

0 commit comments

Comments
 (0)