Open alk-sramond opened 3 years ago
If that can help the regexp is here: https://github.com/danielgtaylor/python-betterproto/blob/master/src/betterproto/casing.py#L14
we can solve locally by replacing WORD_UPPER
-> [A-Z]+(?![a-z])[0-9]*
with [A-Z](?![a-z])[0-9]*
(not sure yet how it impact snake_case
)
We then get ABCDeletedAnswer
Upping this issue as it makes usage of a protobuf registry hard and inconsistent:
For the following protobuf file
package namespace;
message APIRequest {
string api_url = 1;
}
The expected message name is 'namespace.APIRequest'
but betterproto will create an ApiRequest
class instead. As we use cls.__module__ + '.' + cls.__name__
to produce the message name (is there a better way? [1]), things don't map properly across languages.
Thanks in advance
typeName
prop https://github.com/bufbuild/protobuf-es/blob/main/docs/runtime_api.md#message-types
Given the following protobuf:
Version:
betterproto[compiler]
->2.0.0b2
or2.0.0b3
givesVersion:
betterproto[compiler]
->1.2.5
givesIn
2.0.0b2
classnameABC
is turned intoAbc
. Is this something new to betterproto 2 ? Is there an option to specify to allow class-name conservation ?Thanks for the lib and for the support :)
Seems to be coming from: https://github.com/danielgtaylor/python-betterproto/blob/v2.0.0b3/src/betterproto/compile/importing.py#L60
https://github.com/danielgtaylor/python-betterproto/blob/v2.0.0b3/src/betterproto/plugin/models.py#L302