Skip to content

Conversation

TristanFloch
Copy link

This PR builds on top of #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.

@TristanFloch
Copy link
Author

Pinging @pseudomuto as suggested in contributing guidelines 🙂

Tristan Floch added 6 commits July 18, 2023 11:20
This adds a `typeFile` member to message fields.
Those will be empty if the separate file option is off.
Also add new services and messages in Customer.proto to ensure all cross
protofile links are resolved by templates.
@TristanFloch TristanFloch force-pushed the feat/separate-files branch from 0b027e1 to e316abe Compare July 18, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants