Skip to content

Commit a60aa0f

Browse files
committed
Change docs
1 parent 525ea24 commit a60aa0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+123
-174
lines changed

docs/rules/0004/resource-reference-type.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ message Book {
3333
string path = 1;
3434
3535
// This is not a resource reference; the annotation does not belong.
36-
Author author = 2 [(aep.api.field_info).resource_reference = {
37-
type: "library.googleapis.com/Author"
38-
}];
36+
Author author = 2 [(aep.api.field_info).resource_reference = "library.googleapis.com/Author"];
3937
}
4038
```
4139

@@ -55,9 +53,7 @@ message Book {
5553
message Book {
5654
string path = 1;
5755
58-
string author = 2 [(aep.api.field_info).resource_reference = {
59-
type: "library.googleapis.com/Author"
60-
}];
56+
string author = 2 [(aep.api.field_info).resource_reference = "library.googleapis.com/Author"];
6157
}
6258
```
6359

docs/rules/0121/no-mutable-cycles.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ message Book {
3333
3434
// Incorrect. Creates potential reference cycle.
3535
string author = 2 [
36-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Author"
36+
(aep.api.field_info).resource_reference = "library.googleapis.com/Author"
3737
];
3838
}
3939
@@ -47,7 +47,7 @@ message Author {
4747
4848
// Incorrect. Creates potential reference cycle.
4949
string book = 2 [
50-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
50+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
5151
];
5252
}
5353
```
@@ -65,7 +65,7 @@ message Book {
6565
6666
// Correct because the other reference is OUTPUT_ONLY.
6767
string author = 2 [
68-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Author"
68+
(aep.api.field_info).resource_reference = "library.googleapis.com/Author"
6969
];
7070
}
7171
@@ -79,7 +79,7 @@ message Author {
7979
8080
// Correct because an OUTPUT_ONLY reference breaks the mutation cycle.
8181
string book = 2 [
82-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book",
82+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book",
8383
(aep.api.field_behavior) = FIELD_BEHAVIOR_OUTPUT_ONLY
8484
];
8585
}
@@ -102,7 +102,7 @@ message Book {
102102
// (-- api-linter: core::0121::no-mutable-cycles=disabled
103103
// aep.dev/not-precedent: We need to do this because reasons. --)
104104
string author = 2 [
105-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Author"
105+
(aep.api.field_info).resource_reference = "library.googleapis.com/Author"
106106
];
107107
}
108108
@@ -117,7 +117,7 @@ message Author {
117117
// (-- api-linter: core::0121::no-mutable-cycles=disabled
118118
// aep.dev/not-precedent: We need to do this because reasons. --)
119119
string book = 2 [
120-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
120+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
121121
];
122122
}
123123
```

docs/rules/0122/resource-reference-type.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ message Book {
2828
string path = 1;
2929
3030
// Resource references should be strings.
31-
Author author = 2 [(aep.api.field_info).resource_reference = {
32-
type: "library.googleapis.com/Author"
33-
}];
31+
Author author = 2 [(aep.api.field_info).resource_reference = "library.googleapis.com/Author"];
3432
}
3533
```
3634

@@ -41,9 +39,7 @@ message Book {
4139
message Book {
4240
string path = 1;
4341
44-
string author = 2 [(aep.api.field_info).resource_reference = {
45-
type: "library.googleapis.com/Author"
46-
}];
42+
string author = 2 [(aep.api.field_info).resource_reference = "library.googleapis.com/Author"];
4743
}
4844
```
4945

@@ -69,9 +65,7 @@ message Book {
6965
7066
// (-- api-linter: core::0122::resource-reference-type=disabled
7167
// aep.dev/not-precedent: We need to do this because reasons. --)
72-
Author author = 2 [(aep.api.field_info).resource_reference = {
73-
type: "library.googleapis.com/Author"
74-
}];
68+
Author author = 2 [(aep.api.field_info).resource_reference = "library.googleapis.com/Author"];
7569
}
7670
```
7771

docs/rules/0124/reference-same-package.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ message Book {
4646
package google.example.libray.v1; // Typo: Different package.
4747
4848
message GetBookRequest {
49-
string name = 1 [(aep.api.field_info).resource_reference = {
50-
type: "library.googleapis.com/Book" // Lint warning: package mismatch.
51-
}];
49+
string name = 1 [(aep.api.field_info).resource_reference = "library.googleapis.com/Book"]; // Lint warning: package mismatch.
5250
}
5351
```
5452

@@ -70,9 +68,7 @@ message Book {
7068
}
7169
7270
message GetBookRequest {
73-
string name = 1 [(aep.api.field_info).resource_reference = {
74-
type: "library.googleapis.com/Book"
75-
}];
71+
string name = 1 [(aep.api.field_info).resource_reference = "library.googleapis.com/Book"];
7672
}
7773
```
7874

@@ -98,9 +94,7 @@ package google.example.library.v1;
9894
message GetBookRequest {
9995
// (-- api-linter: core::0124::reference-same-package=disabled
10096
// aep.dev/not-precedent: We need to do this because reasons. --)
101-
string name = 1 [(aep.api.field_info).resource_reference = {
102-
type: "library.googleapis.com/Book"
103-
}];
97+
string name = 1 [(aep.api.field_info).resource_reference = "library.googleapis.com/Book"];
10498
}
10599
```
106100

docs/rules/0127/http-template-pattern.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ rpc GetBook(GetBookRequest) returns (Book) {
3636
}
3737
message GetBookRequest {
3838
string path = 1 [
39-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
39+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
4040
];
4141
}
4242
message Book {
@@ -61,7 +61,7 @@ rpc GetBook(GetBookRequest) returns (Book) {
6161
}
6262
message GetBookRequest {
6363
string path = 1 [
64-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
64+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
6565
];
6666
}
6767
message Book {

docs/rules/0131/request-path-behavior.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ value of `FIELD_BEHAVIOR_REQUIRED`.
2929
// Incorrect.
3030
message GetBookRequest {
3131
// The `aep.api.field_behavior` annotation should also be included.
32-
string path = 1 [(aep.api.field_info).resource_reference = {
33-
type: "library.googleapis.com/Book"
34-
}];
32+
string path = 1 [(aep.api.field_info).resource_reference = "library.googleapis.com/Book"];
3533
}
3634
```
3735

@@ -42,7 +40,7 @@ message GetBookRequest {
4240
message GetBookRequest {
4341
string path = 1 [
4442
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
45-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
43+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
4644
];
4745
}
4846
```
@@ -56,9 +54,7 @@ Remember to also include an [aep.dev/not-precedent][] comment explaining why.
5654
message GetBookRequest {
5755
// (-- api-linter: core::0131::request-path-behavior=disabled
5856
// aep.dev/not-precedent: We need to do this because reasons. --)
59-
string path = 1 [(aep.api.field_info).resource_reference = {
60-
type: "library.googleapis.com/Book"
61-
}];
57+
string path = 1 [(aep.api.field_info).resource_reference = "library.googleapis.com/Book"];
6258
}
6359
```
6460

docs/rules/0131/request-path-reference-type.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ message GetBookRequest {
3333
// reference.
3434
string path = 1 [
3535
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
36-
(aep.api.field_info).resource_reference.child_type = "library.googleapis.com/Book"
36+
(aep.api.field_info).resource_reference_child_type = "library.googleapis.com/Book"
3737
];
3838
}
3939
```
@@ -45,7 +45,7 @@ message GetBookRequest {
4545
message GetBookRequest {
4646
string path = 1 [
4747
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
48-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
48+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
4949
];
5050
}
5151
```
@@ -61,7 +61,7 @@ message GetBookRequest {
6161
// aep.dev/not-precedent: We need to do this because reasons. --)
6262
string path = 1 [
6363
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
64-
(aep.api.field_info).resource_reference.child_type = "library.googleapis.com/Book"
64+
(aep.api.field_info).resource_reference_child_type = "library.googleapis.com/Book"
6565
];
6666
}
6767
```

docs/rules/0131/request-path-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ message GetBookRequest {
3939
message GetBookRequest {
4040
string path = 1 [
4141
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
42-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
42+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
4343
];
4444
}
4545
```

docs/rules/0131/request-path-required.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ the `path` field is missing.
2727
message GetBookRequest {
2828
string book = 1 [ // Field path should be `path`.
2929
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
30-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
30+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
3131
];
3232
}
3333
```
@@ -39,7 +39,7 @@ message GetBookRequest {
3939
message GetBookRequest {
4040
string path = 1 [
4141
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
42-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
42+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
4343
];
4444
}
4545
```
@@ -55,7 +55,7 @@ Remember to also include an [aep.dev/not-precedent][] comment explaining why.
5555
message GetBookRequest {
5656
string book = 1 [
5757
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
58-
(aep.api.field_info).resource_reference.type = "library.googleapis.com/Book"
58+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"
5959
];
6060
}
6161
```

docs/rules/0131/request-required-fields.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ message GetBookRequest {
3131
// Format: publishers/{publisher}/books/{book}
3232
string path = 1 [
3333
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
34-
(aep.api.field_info).resource_reference = {
35-
type: "library.googleapis.com/Book"
36-
}];
34+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"];
3735
3836
// Non-standard required field.
3937
google.protobuf.FieldMask read_mask = 2 [(aep.api.field_info).field_behavior = FIELD_BEHAVIOR_REQUIRED];
@@ -49,9 +47,7 @@ message GetBookRequest {
4947
// Format: publishers/{publisher}/books/{book}
5048
string path = 1 [
5149
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
52-
(aep.api.field_info).resource_reference = {
53-
type: "library.googleapis.com/Book"
54-
}];
50+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"];
5551
5652
google.protobuf.FieldMask read_mask = 2 [(aep.api.field_info).field_behavior = OPTIONAL];
5753
}
@@ -68,9 +64,7 @@ message GetBookRequest {
6864
// Format: publishers/{publisher}/books/{book}
6965
string path = 1 [
7066
(aep.api.field_behavior) = FIELD_BEHAVIOR_REQUIRED,
71-
(aep.api.field_info).resource_reference = {
72-
type: "library.googleapis.com/Book"
73-
}];
67+
(aep.api.field_info).resource_reference = "library.googleapis.com/Book"];
7468
7569
// (-- api-linter: core::0131::request-required-fields=disabled
7670
// aep.dev/not-precedent: We really need this field to be required because

0 commit comments

Comments
 (0)