-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Name of Enum type should be in PascalCase #221
Comments
Hi, It makes sense. I will work on it. |
marcosschroh
pushed a commit
that referenced
this issue
Jan 6, 2023
…ases should not apply to enum names. Closes #221
marcosschroh
pushed a commit
that referenced
this issue
Jan 6, 2023
…ases should not apply to enum names. Closes #221
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Sometimes we use avro schemas with different sources (some written in Scala, some in Python, etc). With the case you can generate your schemas according to your programming language convention.
But in Java or Scala, the names of fields are in camelCase and types like Class/Enum are in PascalCase
Enum type's name, like Record name should be always in PascalCase ( I think this is the standard case in Python too )
So today in our case when converting avro to java, generator will not generate a class in PascalCase.
To Reproduce
Example from the doc: https://marcosschroh.github.io/dataclasses-avroschema/case/
{"type": "record", "name": "UserAdvance", "fields": [{"name": "name", "type": "string"}, {"name": "age", "type": "long"}, {"name": "pets", "type": {"type": "array", "items": "string", "name": "pet"}}, {"name": "accounts", "type": {"type": "map", "values": "long", "name": "account"}}, {"name": "favoriteColors", "type": {"type": "enum", "name": "favoriteColor", "symbols": ["BLUE", "YELLOW", "GREEN"]}}, {"name": "hasCar", "type": "boolean", "default": false}, {"name": "country", "type": "string", "default": "Argentina"}, {"name": "address", "type": ["null", "string"], "default": null}, {"name": "md5", "type": {"type": "fixed", "name": "md5", "size": 16}}]}
Expected behavior
I would expect that name of the type Enum should be "type": "enum", "name": "FavoriteColor", like the RecordName on which case rules do no apply.
Maybe there is a trick to do that, but I did not find it in the documentation
The text was updated successfully, but these errors were encountered: