-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Validate resource name uniqueness to provide readable errors
Fixes #672.
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...enerator.Tests/ProtoTests/DuplicateResourceDefinitions/DuplicateResourceDefinitions.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
syntax = "proto3"; | ||
|
||
package testing.duplicateresourcedefinitions; | ||
|
||
import "google/api/client.proto"; | ||
import "google/api/resource.proto"; | ||
|
||
// Deliberately define the same resource twice, to provoke an error. | ||
option (google.api.resource_definition) = { | ||
type: "test.googleapis.com/TestResource" | ||
pattern: "projects/{project}" | ||
}; | ||
|
||
option (google.api.resource_definition) = { | ||
type: "test.googleapis.com/TestResource" | ||
pattern: "organizations/{organization}" | ||
}; | ||
|
||
service Basic { | ||
option (google.api.default_host) = "basic.example.com"; | ||
option (google.api.oauth_scopes) = "scope1,scope2"; | ||
|
||
rpc AMethod(Request) returns(Response); | ||
} | ||
|
||
message Request { | ||
} | ||
|
||
message Response { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters