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
Is there any way to include custom field options or official ones such as json_name in the current version 1.5.1? Is this feature planned or already worked on by any chance?
Quick reproduction example (I used the gradle plugin variant with a custom template file):
{{range .Files}}
{{range .Messages}}
{{range .Fields}}
Options of field {{.Name}}: {{.Options}}
{{end}}
{{end}}
{{end}}
Output:
Options of field test: map[]
Options of field deprecatedTest: map[deprecated:true]
Options of field customTest: map[]
Options of field mixedTest: map[deprecated:true]
While i would expect something like:
Options of field test: map[json_name:TEST]
Options of field deprecatedTest: map[deprecated:true]
Options of field customTest: map[myFlag:true]
Options of field mixedTest: map[json_name:TEST_MIXED,deprecated:true,myFlag:true]
The text was updated successfully, but these errors were encountered:
Hi, thanks for providing this plugin!
Currently, I see no way to include field options (custom or standard ones) in the generated documents.
Briefly looking at the code, there only seem to be two options checked (
deprecated
andidempotency_level
):protoc-gen-doc/template.go
Lines 109 to 121 in df9dd40
#425 might be somewhat similar, but this also includes standard options in proto3.
json_name
would be such an option (see https://protobuf.dev/programming-guides/proto3/#json ) which was already mentioned in a closed issue #17 (comment)Is there any way to include custom field options or official ones such as
json_name
in the current version 1.5.1? Is this feature planned or already worked on by any chance?Quick reproduction example (I used the gradle plugin variant with a custom template file):
The template:
Output:
While i would expect something like:
The text was updated successfully, but these errors were encountered: