Skip to content

Commit 92dfebf

Browse files
author
Caitlin Bales (MSFT)
committed
Add Long Descriptions to templates for Android, CSharp, and PHP
1 parent a588b5b commit 92dfebf

File tree

5 files changed

+71
-6
lines changed

5 files changed

+71
-6
lines changed

Templates/Android/BaseModel.template.tt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ public {1} {2}{3}{4} {{";
619619
var format =
620620
@" /**
621621
* The {0}.
622+
* {4}
622623
*/
623624
@SerializedName(""{1}"")
624625
@Expose
@@ -628,6 +629,7 @@ public {1} {2}{3}{4} {{";
628629
var collectionFormat =
629630
@" /**
630631
* The {0}.
632+
* {4}
631633
*/
632634
public transient {2} {3};
633635

@@ -659,7 +661,8 @@ public {1} {2}{3}{4} {{";
659661
propertyName.SplitCamelCase(),
660662
property.Name,
661663
propertyType,
662-
property.Name.SanitizePropertyName(property).ToLowerFirstChar());
664+
property.Name.SanitizePropertyName(property).ToLowerFirstChar(),
665+
property.LongDescription);
663666
}
664667
return sb.ToString();
665668
}
@@ -671,17 +674,19 @@ public {1} {2}{3}{4} {{";
671674
var format =
672675
@" /**
673676
* The {0}.
677+
* {1}
674678
*/
675-
@SerializedName(""{1}"")
679+
@SerializedName(""{2}"")
676680
@Expose
677-
public {2} {3};
681+
public {3} {4};
678682

679683
";
680684
foreach (var p in parameters)
681685
{
682686
sb.AppendFormat(
683687
format,
684688
ParamName(p).SplitCamelCase(),
689+
p.LongDescription,
685690
ParamName(p),
686691
ParamType(p),
687692
ParamName(p).SanitizePropertyName(p).ToLowerFirstChar()

Templates/CSharp/Model/ComplexType.cs.tt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ namespace <#=complex.Namespace.GetNamespaceName()#>
5959

6060
/// <summary>
6161
/// Gets or sets <#=property.Name#>.
62+
<# if (property.LongDescription != null) {
63+
#>
64+
/// <#=property.LongDescription#>
65+
<# } #>
6266
/// </summary>
6367
<#=attributeDefinition#>
6468
public <#=propertyType#> <#=propertyName#> { get; set; }
@@ -70,6 +74,10 @@ namespace <#=complex.Namespace.GetNamespaceName()#>
7074

7175
/// <summary>
7276
/// Gets or sets <#=property.Name#>.
77+
<# if (property.LongDescription != null) {
78+
#>
79+
/// <#=property.LongDescription#>
80+
<# } #>
7381
/// </summary>
7482
<#=attributeDefinition#>
7583
public <#=propertyType#>? <#=propertyName#> { get; set; }

Templates/CSharp/Model/EntityType.cs.tt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
7070
#>
7171

7272
/// <summary>
73-
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
73+
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
74+
<# if (property.LongDescription != null) {
75+
#>
76+
/// <#=property.LongDescription#>
77+
<# } #>
7478
/// </summary>
7579
<#=attributeDefinition#>
7680
public I<#=propertyCollectionPage#> <#=propertyName.GetSanitizedPropertyName(null, true)#> { get; set; }
@@ -81,7 +85,11 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
8185
#>
8286

8387
/// <summary>
84-
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
88+
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
89+
<# if (property.LongDescription != null) {
90+
#>
91+
/// <#=property.LongDescription#>
92+
<# } #>
8593
/// </summary>
8694
<#=attributeDefinition#>
8795
public IEnumerable<<#=propertyType#>> <#=propertyName.GetSanitizedPropertyName(null, true)#> { get; set; }
@@ -93,7 +101,11 @@ namespace <#=entity.Namespace.GetNamespaceName()#>
93101
#>
94102

95103
/// <summary>
96-
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
104+
/// Gets or sets <#=property.Name.SplitCamelCase().ToLower()#>.
105+
<# if (property.LongDescription != null) {
106+
#>
107+
/// <#=property.LongDescription#>
108+
<# } #>
97109
/// </summary>
98110
<#=attributeDefinition#>
99111
public <#=propertyType#> <#=propertyName.GetSanitizedPropertyName(null, true)#> { get; set; }

Templates/PHP/Model/ComplexType.php.tt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
2929

3030
/**
3131
* Gets the <#=property.Name#>
32+
<# if (property.LongDescription != null) {
33+
#>
34+
* <#=property.LongDescription#>
35+
<# } #>
3236
*
3337
* @return <#=property.Type.GetTypeString()#> The <#=property.Name#>
3438
*/
@@ -53,6 +57,10 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
5357

5458
/**
5559
* Sets the <#=property.Name#>
60+
<# if (property.LongDescription != null) {
61+
#>
62+
* <#=property.LongDescription#>
63+
<# } #>
5664
*
5765
* @param <#=property.Type.GetTypeString()#> $val The value of the <#=property.Name#>
5866
*
@@ -80,6 +88,10 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
8088

8189
/**
8290
* Gets the <#=property.Name#>
91+
<# if (property.LongDescription != null) {
92+
#>
93+
* <#=property.LongDescription#>
94+
<# } #>
8395
*
8496
* @return <#=property.Type.GetTypeString()#> The <#=property.Name#>
8597
*/
@@ -98,6 +110,10 @@ foreach(var property in complex.Properties.Where(prop => prop.Type.GetTypeString
98110

99111
/**
100112
* Sets the <#=property.Name#>
113+
<# if (property.LongDescription != null) {
114+
#>
115+
* <#=property.LongDescription#>
116+
<# } #>
101117
*
102118
* @param <#=property.Type.GetTypeString()#> $val The value to assign to the <#=property.Name#>
103119
*

Templates/PHP/Model/EntityType.php.tt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
6767

6868
/**
6969
* Gets the <#=property.Name#>
70+
<# if (property.LongDescription != null) {
71+
#>
72+
* <#=property.LongDescription#>
73+
<# } #>
7074
*
7175
* @return array The <#=property.Name#>
7276
*/
@@ -81,6 +85,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
8185

8286
/**
8387
* Sets the <#=property.Name#>
88+
<# if (property.LongDescription != null) {
89+
#>
90+
* <#=property.LongDescription#>
91+
<# } #>
8492
*
8593
* @param string $val The <#=property.Name#>
8694
*
@@ -98,6 +106,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
98106

99107
/**
100108
* Gets the <#=property.Name#>
109+
<# if (property.LongDescription != null) {
110+
#>
111+
* <#=property.LongDescription#>
112+
<# } #>
101113
*
102114
* @return <#=property.Type.GetTypeString()#> The <#=property.Name#>
103115
*/
@@ -116,6 +128,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
116128

117129
/**
118130
* Sets the <#=property.Name#>
131+
<# if (property.LongDescription != null) {
132+
#>
133+
* <#=property.LongDescription#>
134+
<# } #>
119135
*
120136
* @param string $val The <#=property.Name#>
121137
*
@@ -139,6 +155,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
139155

140156
/**
141157
* Gets the <#=property.Name#>
158+
<# if (property.LongDescription != null) {
159+
#>
160+
* <#=property.LongDescription#>
161+
<# } #>
142162
*
143163
* @return <#=property.Type.GetTypeString()#> The <#=property.Name#>
144164
*/
@@ -163,6 +183,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
163183

164184
/**
165185
* Sets the <#=property.Name#>
186+
<# if (property.LongDescription != null) {
187+
#>
188+
* <#=property.LongDescription#>
189+
<# } #>
166190
*
167191
* @param <#=property.Type.GetTypeString()#> $val The <#=property.Name#>
168192
*

0 commit comments

Comments
 (0)