I want manually test the bellow gRPC endpoint which returns com.google.type.Money. I am quite new to gRPC/proto world and I have manually tested them with BloomRPC. So far so good. But now there is a specific field type and BloomRPC is complaining with
Error while importing protos
no such Type or Enum 'google.type.Money'
It seems it can't parse google.type.Money. Any clue how I could test my gRPC endpoint manually?
proto file:
syntax = "proto3";
package com.mycomp.adapters.grpc.test;
import "google/api/annotations.proto";
import "google/type/money.proto";
service TestService {
rpc GetTest (GetTestRequest) returns (Test) {
}
}
message GetTestRequest{
string id_cliente = 1;
}
message Test {
string id_cliente = 1;
google.type.Money test_money = 2;
}
gRPC endpoint
import com.google.type.Money
...other imports
@Singleton
class TestEndpoint() : TestServiceGrpcKt.TestServiceCoroutineImplBase() {
override suspend fun getTest(request: GetTestRequest): Test {
val test = Test.newBuilder()
...
test.testMoney = Money.newBuilder()
.setCurrencyCode("USD")
.setUnits(999)
.build();
return test.build()
}
build.gradle dependencies
dependencies {
implementation("io.micronaut:micronaut-validation")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut:micronaut-runtime")
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.micronaut:micronaut-http-client")
implementation ("com.google.api.grpc:proto-google-common-protos:1.0.0")
}