Bird's-view of your proto RPCs in JSON.
✅ Supports google.protobuf.*
types.
✅ Supports all standard protobuf types.
Here are two ways that you can install this tool.
- Go install:
go install github.com/AmirSoleimani/protoseye/cmd/...
- From source code:
git clone [email protected]:AmirSoleimani/protoseye.git
cd protoseye
go install ./cmd/...
protoc-gen-protoseye version
Once you install it, You can easily use it with protoc
find . -name '*.proto' -exec protoc -I=. \
--protoseye_out=./outputs {} \;
E.g. Input:
message GetBirdRequest {
string id = 1;
}
message GetBirdResponse {
string id = 1;
string name = 2;
int age = 3;
google.protobuf.Timestamp created_at = 4;
}
service BirdService {
rpc GetBird(GetBirdRequest) GetBirdResponse;
}
Output:
// BirdService_bird.GetBirdRequest.json
{
"id": "mystring"
}
// BirdService_bird.GetBirdResponse.json
{
"id": "mystring",
"name": "name",
"age": 13,
"created_at": {
"nanos": 32,
"seconds": 64
}
}
If you have a complex data structure, getting a good insight into the input and output of your RPCs won't be easy (It gets worse when you have an enormous payload). This tool helps you generate a JSON representation of the RPC request and response.
- Enhance test coverage.
- Generate smarter and more specific random values.
- Support custom and predefined field value.
- Support Directory Tree style besides JSON.