update tests and go.mod
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
76
server/http/proto/test.proto
Normal file
76
server/http/proto/test.proto
Normal file
@@ -0,0 +1,76 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package test;
|
||||
option go_package = "github.com/unistack-org/micro-tests/server/http/proto;pb";
|
||||
import "google/api/annotations.proto";
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
service Test {
|
||||
rpc Call(CallReq) returns (CallRsp) {
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
operation_id: "Call";
|
||||
responses: {
|
||||
key: "default";
|
||||
value: {
|
||||
description: "Error response";
|
||||
schema: {
|
||||
json_schema: {
|
||||
ref: ".test.Error";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
option (google.api.http) = { post: "/v1/test/call/{name}"; body: "*"; };
|
||||
};
|
||||
rpc CallError(CallReq1) returns (CallRsp1) {
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
operation_id: "CallError";
|
||||
responses: {
|
||||
key: "default";
|
||||
value: {
|
||||
description: "Error response";
|
||||
schema: {
|
||||
json_schema: {
|
||||
ref: ".test.Error";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
option (google.api.http) = { post: "/v1/test/callerror/{name}"; body: "*"; };
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
message CallReq {
|
||||
string name = 1;
|
||||
string req = 2;
|
||||
string arg1 = 3;
|
||||
uint64 arg2 = 4;
|
||||
Nested nested = 5;
|
||||
};
|
||||
|
||||
message Nested {
|
||||
repeated string string_args = 1;
|
||||
repeated google.protobuf.UInt64Value uint64_args = 2;
|
||||
}
|
||||
|
||||
message CallRsp {
|
||||
string rsp = 2;
|
||||
};
|
||||
|
||||
message CallReq1 {
|
||||
string name = 1;
|
||||
string req = 2;
|
||||
};
|
||||
|
||||
message CallRsp1 {
|
||||
string rsp = 2;
|
||||
};
|
||||
|
||||
|
||||
message Error {
|
||||
string msg = 1;
|
||||
};
|
Reference in New Issue
Block a user