File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,26 @@ backwards-compatility. Nontheless, this annotation **must not** be omitted.
4242only, and does not itself add any validation. The purpose is to consistently
4343document this behavior for clients.
4444
45+ ### field behavior of nested messages
46+
47+ ` google.api.field_behavior ` annotations on a nested message are independent of
48+ the annotations of the parent.
49+
50+ For example, a nested message can have a field behavior of ` REQUIRED ` while the
51+ parent field can be ` OPTIONAL ` :
52+
53+ ``` proto
54+ message Title {
55+ string text = 1 [(google.api.field_behavior) = REQUIRED];
56+ }
57+
58+ message Slide {
59+ Title title = 1 [(google.api.field_behavior) = OPTIONAL];
60+ }
61+ ```
62+
63+ In the case above, if a ` title ` is specified, the ` text ` field is required.
64+
4565## Vocabulary
4666
4767### Identifier
@@ -246,6 +266,8 @@ surpass the costs to clients and API users of not doing so.
246266
247267## Changelog
248268
269+ - ** 2023-09-14** : Clarify that nested behavior and parent behavior are
270+ independent.
249271- ** 2023-08-25** : Add guidance on ` IDENTIFIER ` .
250272- ** 2023-07-20** : Describe compatibility guidance with new section.
251273- ** 2023-05-24** : Clarify that ` IMMUTABLE ` does not imply input nor required.
You can’t perform that action at this time.
0 commit comments