You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Jenny,
I added this testcase in mine forked branch, that shows incorrect resolution of StaticRoute field: master...80220:protobuf2swagger:patch/bad_resolution
Looking at Json Descriptor object (root) I can't find a way to resolve this import properly. Wonder if that is a problem in dependant lib (protobufjs) maybe it creates invalid tree out of proto files?
Adding logging to display the field, its type is StaticRoute and the root tree contains 2 definitions of it under different namespaces and the wrong one is resolved (not the one indicated by import in request.proto file)
My assumption is, that the type attribute of the field should be set to: type: 'a.b.c.d.StaticRoute', (as per import statement)
instead of type: 'StaticRoute',
that would assure proper resolution.
But if so then the problem is in protobuf.js that builds this json tree out of proto files.
Gimme your thoughts on this/thanks!
The text was updated successfully, but these errors were encountered:
then you tried to generate one swagger JSON with all these protobufs.
It seems to me that when backend defines the protos, a/b/c/d/request.proto is for one set of APIs and a/b/common.proto is for another set, which means they are better not to be generated in one single Swagger JSON as they are probably running on two different servers and you have no idea what kind of conflicts they have.
Hi Jenny,
I added this testcase in mine forked branch, that shows incorrect resolution of StaticRoute field:
master...80220:protobuf2swagger:patch/bad_resolution
Looking at Json Descriptor object (root) I can't find a way to resolve this import properly. Wonder if that is a problem in dependant lib (protobufjs) maybe it creates invalid tree out of proto files?
Adding logging to display the field, its type is StaticRoute and the root tree contains 2 definitions of it under different namespaces and the wrong one is resolved (not the one indicated by import in request.proto file)
My assumption is, that the type attribute of the field should be set to:
type: 'a.b.c.d.StaticRoute',
(as per import statement)instead of
type: 'StaticRoute',
that would assure proper resolution.
But if so then the problem is in protobuf.js that builds this json tree out of proto files.
Gimme your thoughts on this/thanks!
The text was updated successfully, but these errors were encountered: