A worked example, rendered from real sample data. Sign in to run the tool on your own input.
syntax = "proto3";
package users;
service UserService {
rpc GetUser (UserId) returns (User);
rpc ListUsers (Empty) returns (UserList);
}
message User {
string id = 1;
string name = 2;
string email = 3;
}
message UserId {
string id = 1;
}
message UserList {
repeated User users = 1;
}
message Empty {}━━━ Outline ━━━
═══ Proto file ═══
Syntax: proto3
Package: users
Imports: (none)
Services: 1
RPC methods: 2
Messages: 4
Enums: 0
Fields: 5
═══ service UserService ═══
• GetUser — unary
UserId → User
grpcurl -plaintext -d '{}' localhost:50051 users.UserService/GetUser
• ListUsers — unary
Empty → UserList
grpcurl -plaintext -d '{}' localhost:50051 users.UserService/ListUsers
═══ message User ═══
1 string id
2 string name
3 string email
═══ message UserId ═══
1 string id
═══ message UserList ═══
1 repeated User users
═══ message Empty ═══
ℹ No fields.
━━━ JSON mapping ━━━
═══ proto3 JSON mapping ═══
─── users.User ───
id: string
name: string
email: string
─── users.UserId ───
id: string
─── users.UserList ───
users: array of object
─── users.Empty ───
(empty object)
━━━ Sample payload ━━━
═══ Sample payloads ═══
─── User ───
{
"id": "01H8XKQ0R2SVT4",
"name": "sample name",
"email": "sample email"
}
─── UserId ───
{
"id": "01H8XKQ0R2SVT4"
}
─── UserList ───
{
"users": [
{
"id": "01H8XKQ0R2SVT4",
"name": "sample name",
"email": "sample email"
}
]
}
─── Empty ───
{}
━━━ grpcurl ━━━
═══ grpcurl ═══
ℹ Replace localhost:50051 with your server. This tool never makes a network call.
grpcurl -plaintext localhost:50051 list
─── GetUser (unary) ───
grpcurl -plaintext -d '{"id":"01H8XKQ0R2SVT4"}' localhost:50051 users.UserService/GetUser
─── ListUsers (unary) ───
grpcurl -plaintext -d '{}' localhost:50051 users.UserService/ListUsers
━━━ Report ━━━
═══ Wire compatibility ═══
Errors: 0
W
…
Parse a .proto file — services, messages, JSON mapping and wire-compatibility checks. Part of the DevTools Surf developer suite. Browse more tools in the API / Config collection.