Skip to content

Commit 6acf132

Browse files
authored
Use aep.api.resource instead of google.api.resource (#119)
1 parent 01e0af5 commit 6acf132

File tree

107 files changed

+458
-1047
lines changed

Some content is hidden

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

107 files changed

+458
-1047
lines changed

docs/rules/0004/duplicate-resource.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ redirect_from:
1111
# Resource annotation presence
1212

1313
This rule enforces that the same resource type doesn't appear in more than one
14-
`google.api.resource` annotation, as described in [AEP-004][].
14+
`aep.api.resource` annotation, as described in [AEP-004][].
1515

1616
## Details
1717

1818
This rule complains about messages that have the same `type` for the
19-
`google.api.resource` annotation, which frequently occur due to copy-paste
19+
`aep.api.resource` annotation, which frequently occur due to copy-paste
2020
errors and messages spread across multiple files and/or packages. Duplicate
2121
resource definitions can cause compilation problems in generated client code.
2222

@@ -26,7 +26,7 @@ resource definitions can cause compilation problems in generated client code.
2626

2727
```proto
2828
message Book {
29-
option (google.api.resource) = {
29+
option (aep.api.resource) = {
3030
type: "library.googleapis.com/Book"
3131
pattern: "publishers/{publisher}/books/{book}"
3232
};
@@ -35,7 +35,7 @@ message Book {
3535
}
3636
3737
message Author {
38-
option (google.api.resource) = {
38+
option (aep.api.resource) = {
3939
// Incorrect: should be "library.googleapis.com/Author".
4040
type: "library.googleapis.com/Book"
4141
pattern: "authors/{author}"
@@ -50,7 +50,7 @@ message Author {
5050
```proto
5151
// Correct.
5252
message Book {
53-
option (google.api.resource) = {
53+
option (aep.api.resource) = {
5454
type: "library.googleapis.com/Book"
5555
pattern: "publishers/{publisher}/books/{book}"
5656
};
@@ -59,7 +59,7 @@ message Book {
5959
}
6060
6161
message Author {
62-
option (google.api.resource) = {
62+
option (aep.api.resource) = {
6363
type: "library.googleapis.com/Author"
6464
pattern: "authors/{author}"
6565
};
@@ -79,7 +79,7 @@ Remember to also include an [aep.dev/not-precedent][] comment explaining why.
7979
syntax = "proto3";
8080
8181
message Book {
82-
option (google.api.resource) = {
82+
option (aep.api.resource) = {
8383
type: "library.googleapis.com/Book"
8484
pattern: "publishers/{publisher}/books/{book}"
8585
};
@@ -88,7 +88,7 @@ message Book {
8888
}
8989
9090
message Author {
91-
option (google.api.resource) = {
91+
option (aep.api.resource) = {
9292
type: "library.googleapis.com/Book"
9393
pattern: "authors/{author}"
9494
};

docs/rules/0004/path-never-optional.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ proto3_optional.
1515

1616
## Details
1717

18-
This rule scans for messages with a `google.api.resource` annotation and ensures
18+
This rule scans for messages with a `aep.api.resource` annotation and ensures
1919
that the configured path field (either `path` or whichever field specified via
2020
`path_field`) is not labeled as `optional`.
2121

@@ -26,7 +26,7 @@ that the configured path field (either `path` or whichever field specified via
2626
```proto
2727
// Incorrect.
2828
message Book {
29-
option (google.api.resource) = {
29+
option (aep.api.resource) = {
3030
type: "library.googleapis.com/Book"
3131
pattern: "publishers/{publisher}/books/{book}"
3232
};
@@ -41,7 +41,7 @@ message Book {
4141
```proto
4242
// Correct.
4343
message Book {
44-
option (google.api.resource) = {
44+
option (aep.api.resource) = {
4545
type: "library.googleapis.com/Book"
4646
pattern: "publishers/{publisher}/books/{book}"
4747
};
@@ -58,7 +58,7 @@ If you need to violate this rule, use a leading comment above the message.
5858
// (-- api-linter: core::04::path-never-optional=disabled
5959
// aep.dev/not-precedent: We need to do this because reasons. --)
6060
message Book {
61-
option (google.api.resource) = {
61+
option (aep.api.resource) = {
6262
type: "library.googleapis.com/Book"
6363
pattern: "publishers/{publisher}/books/{book}"
6464
};

docs/rules/0004/resource-annotation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
rule:
33
aep: 4
44
name: [core, '4', resource-annotation]
5-
summary: Resource messages should be annotated with `google.api.resource`.
5+
summary: Resource messages should be annotated with `aep.api.resource`.
66
permalink: /4/resource-annotation
77
redirect_from:
88
- /4/resource-annotation
@@ -11,13 +11,13 @@ redirect_from:
1111
# Resource annotation presence
1212

1313
This rule enforces that top-level messages that appear to represent resources
14-
have a `google.api.resource` annotation, as described in [AEP-4][].
14+
have a `aep.api.resource` annotation, as described in [AEP-4][].
1515

1616
## Details
1717

1818
This rule scans all top-level messages, and assumes that messages with a
1919
`string path` field are resources unless the message name ends with `Request`.
20-
For messages that are resources, it complains if the `google.api.resource`
20+
For messages that are resources, it complains if the `aep.api.resource`
2121
annotation is missing.
2222

2323
## Examples
@@ -27,7 +27,7 @@ annotation is missing.
2727
```proto
2828
// Incorrect.
2929
message Book {
30-
// A `google.api.resource` annotation should be here.
30+
// A `aep.api.resource` annotation should be here.
3131
string path = 1;
3232
}
3333
```
@@ -37,7 +37,7 @@ message Book {
3737
```proto
3838
// Correct.
3939
message Book {
40-
option (google.api.resource) = {
40+
option (aep.api.resource) = {
4141
type: "library.googleapis.com/Book"
4242
pattern: "publishers/{publisher}/books/{book}"
4343
};

docs/rules/0004/resource-definition-pattern.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

docs/rules/0004/resource-definition-type-name.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

docs/rules/0004/resource-definition-variables.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)