Files
paralus/components/common/pkg/gateway/testdata/test.proto
2021-12-28 14:23:52 +05:30

58 lines
1.5 KiB
Protocol Buffer

syntax = "proto3";
package testdata;
import "google/api/annotations.proto";
import "gogoproto/gogo.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/protobuf/timestamp.proto";
// Enable custom Marshal method.
option (gogoproto.marshaler_all) = true;
// Enable custom Unmarshal method.
option (gogoproto.unmarshaler_all) = true;
// Enable custom Size method (Required by Marshal and Unmarshal).
option (gogoproto.sizer_all) = true;
// Enable registration with golang/protobuf for the grpc-gateway.
option (gogoproto.goproto_registration) = true;
// Enable generation of XXX_MessageName methods for grpc-go/status.
option (gogoproto.messagename_all) = true;
message TestYAML {
string name = 1;
google.protobuf.Timestamp time = 2 [
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
read_only : true
},
(gogoproto.stdtime) = true
];
map<string, string> labels = 3;
}
message TestMetadata {
string name = 1;
}
message TestObjectSpec {}
message TestObjectStatus {}
message TestObject {
TestMetadata metadata = 1 [
(gogoproto.embed) = true,
(gogoproto.nullable) = false,
(gogoproto.jsontag) = ",inline"
];
TestObjectSpec spec = 2
[ (gogoproto.nullable) = false, (gogoproto.embed) = true ];
TestObjectStatus status = 3
[ (gogoproto.nullable) = false, (gogoproto.embed) = true ];
}
service Test {
rpc Get(TestObject) returns (TestObject) {
option (google.api.http) = {
get : "/v3/test/{metadata.name}/test/{metadata.name}"
};
}
}