github.com/cbroglie/openapi2proto@v0.0.0-20171004221549-76b8501da882/fixtures/cats.proto (about) 1 syntax = "proto3"; 2 3 import "google/protobuf/empty.proto"; 4 5 import "google/protobuf/timestamp.proto"; 6 7 package cats; 8 9 message GetCatIdProtoJSONRequest { 10 // The transport to respond with (Protobuf or JSON) 11 string ProtoJSON = 1; 12 // The Cat ID to get 13 int64 id = 2; 14 } 15 16 message GetCatsProtojsonRequest { 17 // Limiting the number of cats 18 int64 limit = 1; 19 // The transport to respond with (Protobuf or JSON) 20 string protojson = 2; 21 } 22 23 message PutCatsProtojsonRequest { 24 // A batch of cats to save to the db. 25 repeated Cat cats = 1; 26 // The transport to respond with (Protobuf or JSON) 27 string protojson = 2; 28 } 29 30 message Cat { 31 string breed = 1; 32 google.protobuf.Timestamp dateOfBirth = 2; 33 int64 id = 3; 34 string name = 4; 35 } 36 37 message Cats { 38 repeated Cats cats = 1; 39 } 40 41 message Error { 42 string Message = 1; 43 } 44 45 service CatsService { 46 // View a single `Cat` from the database via JSON or Protobuf 47 rpc GetCatIdProtoJSON(GetCatIdProtoJSONRequest) returns (Cat) {} 48 // Lists `Cats` as JSON 49 rpc GetCatsProtojson(GetCatsProtojsonRequest) returns (Cats) {} 50 // Saves a list of `Cats` via JSON or Protobuf 51 rpc PutCatsProtojson(PutCatsProtojsonRequest) returns (google.protobuf.Empty) {} 52 }