Open corntoole opened 3 years ago
good catch, @corntoole.
Descriptors for state transitions should use camel-case; data descriptors should use camel-case or snake-case as appropriate.
I assume this is "best/oreferred practice" for proto files, right?
any chance you can scaratch out some simple "rules" (e.g. when to use camelCase
vs. snake_case
) here in the thread to inform the transformation?
i'd be happy to code up the rules into the tool.
thx.
Yes, the suggested naming convention for protocol buffers is for message names to be camel-case, e.g. date-time -> DateTime
; whereas, field names should be snake-case, e.g. date-time -> string date_time
.
I haven't yet found an official style guide for graphQL, but it seems that types names should be capitalized-camel-case and all other identifiers camel-case.
@corntoole:
very good. thanks for the great proto styleguide reference![1]
so, for .proto
files we'll use upper camel case (aka Pascal case[2]) for MessageNames
, ServiceNames
, and MethodNames
. Then snake case for field_names
. if/when Enums come up, i'll know where to look.
if/when you find a solid style guide for SDL/GraphQL or OpenAPI feel free to start a new issue for them, too.
[1] https://developers.google.com/protocol-buffers/docs/style#message_and_field_names [2] https://en.wikipedia.org/wiki/Camel_case#Variations_and_synonyms
@corntoole:
added a branch w/ your suggested changes: https://github.com/mamund/alps-unified/pull/13
can you check this out and add remarks?
if all is good, i'll do the merge when you're ready.
@corntoole
sorry for the radio silence. i got stumped as i was working to incorporate some of the work of @mmuller88 and his WSD CDK project.
i'll circle back and see where we can pick up on this in the next week or so.
hope to see you on the mailing list and at one of our ALPS Open Office Hours sometime soon, too.
-- @mamund
When unified is given descriptors with multi-word, dash-delimited identifiers e.g.
date-time
, it outputs types and RPCs with invalid names in SDL and ProtocolBuffer syntax.Example 1
Descriptors for state transitions should use camel-case; data descriptors should use camel-case or snake-case as appropriate.
Here is the full ALPS yaml that I'm testing. I converted it from alps-io/profiles/xml/microblogging.xml