Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for non-user-settable-ids #39

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
824 changes: 536 additions & 288 deletions example/bookstore/v1/bookstore.pb.go

Large diffs are not rendered by default.

240 changes: 240 additions & 0 deletions example/bookstore/v1/bookstore.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions example/bookstore/v1/bookstore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ service Bookstore {
option (google.api.method_signature) = "parent";
}

// An aep-compliant Create method for isbn.
rpc CreateIsbn ( CreateIsbnRequest ) returns ( Isbn ) {
option (google.api.http) = { post: "/{parent=isbns}", body: "isbn" };

option (google.api.method_signature) = "parent,isbn";
}

// An aep-compliant Get method for isbn.
rpc GetIsbn ( GetIsbnRequest ) returns ( Isbn ) {
option (google.api.http) = { get: "/{path=isbns/*}" };

option (google.api.method_signature) = "path";
}

// An aep-compliant Create method for publisher.
rpc CreatePublisher ( CreatePublisherRequest ) returns ( Publisher ) {
option (google.api.http) = {
Expand Down Expand Up @@ -333,6 +347,39 @@ message ListBookEditionsResponse {
string next_page_token = 10011;
}

// A Isbn.
message Isbn {
// Field for path.
string path = 10000;

// Field for id.
string id = 10001;
}

// A Create request for a isbn resource.
message CreateIsbnRequest {
// A field for the parent of isbn
string parent = 10013 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { }
];

// An id that uniquely identifies the resource within the collection
string id = 10014;

// The resource to perform the operation on.
Isbn isbn = 10015 [(google.api.field_behavior) = REQUIRED];
}

// Request message for the Getisbn method
message GetIsbnRequest {
// The globally unique identifier for the resource
string path = 10018 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "bookstore.example.com/isbn" }
];
}

// A Publisher.
message Publisher {
// Field for description.
Expand Down
Loading
Loading