fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.36k stars 497 forks source link

Grpcurl not able to parse validate/validate.proto #340

Open prssnk opened 1 year ago

prssnk commented 1 year ago

We have implemented proto messages that uses envoy validate.proto to validate fields within messages. The application consuming the proto is implemented using spring boot and works fine correctly. The grpcurl command fails with validate/validate.proto no such file or directory. The command: ./grpcurl -d '{"userId": "123"}' -import-path /home/psankaranarayanan/staging/pcap-service-contracts/core-api-contract/src/main/proto/ -proto account_service.proto com.account.AccountService/getAccounts

jhump commented 1 year ago

Does validate/validate.proto also exist under /home/psankaranarayanan/staging/pcap-service-contracts/core-api-contract/src/main/proto/?

If not, that's the problem: you have to tell grpcurl where all of your proto sources will be using -import-path (much like using -I arguments to protoc).