Skip to content

Commit 775e5e1

Browse files
committed
feat: Add relevant attribute descriptions where available (step 1) (#6295)
1 parent fa912da commit 775e5e1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

generator/src/googleapis/codegen/languages/php/default/templates/___api_className___/___models_className___.php.tmpl

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ class {{ model.className }} extends {% if model.superClass %}{{ model.superClass
2828
{% else %}
2929
{% if property.annotationType %}
3030
/**
31+
{% if property.description %}
32+
{% if property.description %}
33+
{% filter block_comment %}
34+
* {{ property.description }}
35+
{% endfilter %}
36+
*
37+
{% endif %}
38+
{% endif %}
3139
* @var {{ property.annotationType }}{% if property.dataType == "array" or property.dataType == "map" %}[]{% endif %}
3240
*/
3341
{% endif %}

generator/tests/testdata/golden/php/default/kitchen_sink.golden

+8
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,8 @@ namespace Google\Service\KitchSink;
747747
class Enum extends \Google\Model
748748
{
749749
/**
750+
* Enum type name.
751+
*
750752
* @var string
751753
*/
752754
public $name;
@@ -991,6 +993,8 @@ namespace Google\Service\KitchSink;
991993
class KitchSinkReadOnly extends \Google\Model
992994
{
993995
/**
996+
* ReadOnly type name.
997+
*
994998
* @var string
995999
*/
9961000
public $name;
@@ -3351,10 +3355,14 @@ class SubmissionAttribution extends \Google\Model
33513355
"object" => "$object",
33523356
];
33533357
/**
3358+
* A member with a $ in the name
3359+
*
33543360
* @var string
33553361
*/
33563362
public $avatarUrl;
33573363
/**
3364+
* A member with a $ in the name, but if you strip it, you get a reserved word
3365+
*
33583366
* @var string
33593367
*/
33603368
public $object;

0 commit comments

Comments
 (0)