This PR builds on top of https://github.com/pseudomuto/protoc-gen-doc/pull/492 (which is approved but not yet merged).
The later supports splitting the generated documentation into separate files. But when files import each other, the template has no way to know in which file a particular message is defined.
This PR adds the TypeFile member to MessageField template objects, a string designing the file where the type is originally defined. Likewise for Request and Response types in ServiceMethods.
Those attributes allow templates to craft cross file links to type definitions.
Since this impacts performance, it is only enabled when the separate_files option is enabled.
If separate_files is disabled or the type has no particular file (literal types for instance), the TypeFile field will be empty.
This PR builds on top of https://github.com/pseudomuto/protoc-gen-doc/pull/492 (which is approved but not yet merged). The later supports splitting the generated documentation into separate files. But when files import each other, the template has no way to know in which file a particular message is defined.
This PR adds the
TypeFile
member toMessageField
template objects, a string designing the file where the type is originally defined. Likewise for Request and Response types inServiceMethod
s.Those attributes allow templates to craft cross file links to type definitions.
Since this impacts performance, it is only enabled when the
separate_files
option is enabled. Ifseparate_files
is disabled or the type has no particular file (literal types for instance), theTypeFile
field will be empty.