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]
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
): https://github.com/pseudomuto/protoc-gen-doc/blob/df9dd4078971bb01d06bcd88130a7b5309348be0/template.go#L109-L121https://github.com/pseudomuto/protoc-gen-doc/issues/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 https://github.com/pseudomuto/protoc-gen-doc/issues/17#issuecomment-282540156Is 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: