Closed S-Eibl closed 2 years ago
How is this issue different from #3?
The protoparser parses RPC functions with their Name, Comments, etc. The
RequestType
andResponseType
are stored as strings but should be linked to the corresponding messages. This is necessary to determine request- and return type for the thing description later. Therefor the following steps are necessary:
OK, now I'm getting finer image of what you are trying to do, but not entirely sure, yet. I will pay visits to other younger issues.
Instead of creating a map before constructing the resulting TD, I would dynamically generate forms as the each handler Walk the protobuf.
My bad, you are right. It is indeed a bad idea to recursively find the Message
for each RPC function.
I am first creating a map of the Message name and the wot.DataSchema
type.
The emicklei/proto parses RPC functions with their Name, Comments, etc. The
RequestType
andResponseType
are stored as strings but should be linked to the corresponding messages. This is necessary to determine request- and return type for the thing description later. Therefor the following steps are necessary:(*proto.RPC)
, its ReturnType(*proto.Message)
and its RequestType(*proto.Message)
. This will ensure the linkage between the RPC and its typeslinkedRPC
instead of*proto.RPC
addRPC(rpc *proto.RPC)
should be updated to generate linkedRPCproto.Walk
function has to be called twice to first fill the messages and then fill therpcFunctions
to ensure that the messages for the functions can be found