-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do grpc-server nodes support import in proto files? #19
Comments
Is there a problem with copy/pasting the content? Sorry I was a bit busy, will working on the PR as soon as I can. |
Well, it might honestly be my inexperience with gRPC. I need to import a separate proto file that has a different package namespace for messages. So if I have the following:
and the references to sila2.org.silastandard.Real come from the import:
and I am unsure then how I can just paste in the 'Real' message definition as 'message sila2.org.silastandard.Real..' gives me errors:
|
Oh no this isn't supported. The only packages you can import is the
standard ones from google: com.google...
A quick workaround I suppose, is to merge your proto files into one file
and then copy the content over to the node.
…On Wed., Apr. 21, 2021, 7:00 p.m. Jeff Bonevich, ***@***.***> wrote:
Well, it might honestly be my inexperience with gRPC. I need to import a
separate proto file that has a different package namespace for messages. So
if I have the following:
syntax = "proto3";
import "SiLAFramework.proto";
package bonez.dht11;
// Feature: DHT11 SiLA2 Provider
// SiLA2 drivers for the DHT11 Humiture Sensor
service DHT11Provider {
rpc GetTemperature(bonez.dht11.GetTemperature_Parameters) returns (bonez.dht11.GetTemperature_Responses) {}
rpc GetHumidity(bonez.dht11.GetHumidity_Parameters) returns (bonez.dht11.GetHumidity_Responses) {}
}
// ------ Command Parameter and Response definitions -------
message GetTemperature_Parameters {
}
message GetTemperature_Responses {
sila2.org.silastandard.Real Temperature = 1;
}
message GetHumidity_Parameters {
}
message GetHumidity_Responses {
sila2.org.silastandard.Real Humidity = 1;
}
and the references to sila2.org.silastandard.Real come from the import:
syntax = "proto3";
package sila2.org.silastandard;
option java_outer_classname = "SiLAFramework";
// -------- SiLA Basic Types --------
[snipped]
message Real {
double value = 1;
}
and I am unsure then how I can just paste in the 'Real' message definition
as 'message sila2.org.silastandard.Real..' gives me errors:
"createGRPCServer - Error: illegal type name 'sila2.org.silastandard.Real' (/var/folders/vr/9bgzlkzs4z7_zxmv64n70d5xg15dzy/T/foobar-jcNOFO/proto.txt, line 29)"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHU7IAJXJROBJNPAGDRXCTTJ57MPANCNFSM43LL3SGQ>
.
|
I do not see support for imports of external proto files into the definition supplied to a grpc-server? Is this a feature on the roadmap? or am I (as usual) just missing how to do this? Thanks!
The text was updated successfully, but these errors were encountered: