-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Imports raise SyntaxError with FieldName as originalCase #646
Comments
I can confirm the issue @fteule thanks for reporting! |
Hi, Thanks for this correction but I encounter an other mistake with it on my data model. For information my original data package is the same that in #643 With the correct Sample2 example and below the error: |
Please don't use the same convention for both class and field names, in the generated models we have a field with the same name and type as another class. Its the cause of the issue and it's pretty impossible to solve, the genrator would have to cross check all field names with all class names and start appending suffixes and thus loosing the whole point of the class unit(Enum):
M = "m"
KG = "kg"
VALUE = "%"
NA = "NA"
@dataclass
class myComplexType2:
....
unit: Optional[unit] = field(
.... |
The fix for the initial issue is on master and will be on the next release! |
perfect, thanks for all ! |
Hi,
I some cases I detected that generated bindings could be invalid when I set in the config FieldName to originalCase.
The generation ends successfully but when I import the module an exception is raised:
If I set in configuration FieldName to pascalCase, the field is correctly generated as "Value".
I prepared a sample package that reproduce problem:
Sample.tar.gz
I tried to change safePrefix value but it doesn't change this behavior.
Thank you for this library
The text was updated successfully, but these errors were encountered: