60 lines
1.3 KiB
Protocol Buffer
60 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package github;
|
|
option go_package = "github.com//unistack-org/micro-tests/client/http/proto;pb";
|
|
|
|
import "api/annotations.proto";
|
|
import "openapiv2/annotations.proto";
|
|
|
|
service Github {
|
|
rpc LookupUser(LookupUserReq) returns (LookupUserRsp) {
|
|
option (micro.openapiv2.openapiv2_operation) = {
|
|
operation_id: "LookupUser";
|
|
responses: {
|
|
response_code: {
|
|
name: "default";
|
|
value: {
|
|
json_reference: {
|
|
description: "Error response";
|
|
_ref: ".github.Error";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
option (micro.api.http) = { get: "/users/{username}"; };
|
|
};
|
|
rpc LookupUserWithoutPath(LookupUserReq) returns (LookupUserRsp) {
|
|
option (micro.openapiv2.openapiv2_operation) = {
|
|
operation_id: "LookupUserWithoutPath";
|
|
responses: {
|
|
response_code: {
|
|
name: "default";
|
|
value: {
|
|
json_reference: {
|
|
description: "Error response";
|
|
_ref: ".github.Error";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
option (micro.api.http) = { get: "/{username}"; };
|
|
};
|
|
|
|
};
|
|
|
|
message LookupUserReq {
|
|
string username = 1;
|
|
};
|
|
|
|
message LookupUserRsp {
|
|
string name = 1;
|
|
};
|
|
|
|
message Error {
|
|
string message = 1;
|
|
string documentation_url = 2;
|
|
};
|
|
|