Skip to content

Can't get camel_case_fields=true to work #551

@Samuel-Therrien-Beslogic

Description

Context

We are trying to create documentation for a WIP protobuf-based API. All we are given are the .proto files and a WIP C# demo client application where the C# proto code has already been generated.

I've successfully managed to use this application (protoc-gen-doc) to produce a readable and searchable HTML file. As well as a markdown tree.

But I am left with 1 single issue, the class members in C# are using CamelCase, whilst the proto files are using snake_case. So in the generated documentation, the members don't match what's used in code.

What I'm trying to do

For example, in C# code you'd have User.FirstName, whilst in the doc it'll show as first_name under User

Image

I want the above doc to show FirstName and LastName. It looks this this functionality should have been added in #540

This is as much as I think I can show of the command that I currently use (and works to generate the doc with snake_case members):

protoc `
  --doc_out=$PSScriptRoot/protoc-gen-doc `
  --doc_opt="html,index.html" `
  --proto_path="$PSScriptRoot/<redacted>/proto" `
  $ProtoWildcards

(where $ProtoWildcards is just a list of folders ending with /*.proto because I couldn't get ** wildcards to work. Something like $PSScriptRoot/<redacted>/proto/some/paths/v1/*.proto)

What I tried

I've tried the following with no change in output:

--doc_opt="html,index.html: :camel_case_fields=true"
--doc_opt="html,index.html:camel_case_fields=true"
--doc_opt="html,index.html:nothing_to_exlude:camel_case_fields=true"

The following just doesn't output any HTML:
--doc_opt="html,index.html::camel_case_fields=true"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions