-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Keep the same "case" in the class names #498
Comments
Check the generator config , you can select the name case for classes and fields, set the class name case to originalCase |
Below works, for me but when changing FieldName to originalCase as well, I end up with:
xsdata generate -c config.xml -p onix --structure-style single-package ONIX_BookProduct_3.0_reference.xsd <?xml version="1.0" encoding="UTF-8"?>
<Config xmlns="http://pypi.org/project/xsdata" version="21.4">
<Output maxLineLength="79">
<Package>generated</Package>
<Format>dataclasses</Format>
<Structure>filenames</Structure>
<DocstringStyle>reStructuredText</DocstringStyle>
<CompoundFields>false</CompoundFields>
</Output>
<Conventions>
<ClassName case="originalCase" safePrefix="type"/>
<FieldName case="snakeCase" safePrefix="value"/>
<ConstantName case="screamingSnakeCase" safePrefix="value"/>
<ModuleName case="snakeCase" safePrefix="mod"/>
<PackageName case="snakeCase" safePrefix="pkg"/>
</Conventions>
</Config> |
In addition to that, the generated code has syntax errors;
|
I have been using 52, but there is a new source release here: https://www.editeur.org/files/ONIX%203/ONIX_BookProduct_XSD_schema+codes_Issue_53.zip |
For the exception during the generation, there is a fix on master for that, thank you for reporting, I guess no-one tried it before for the field names. For the second part unfortunately that's what the original case is supposed to do, return the original string without any modifications, even if the produced code has syntax errors. Try one of the mixed cases |
At this moment it seems that xsData is transforming the casing of an element to something "pythonish" would it be possible to keep the "original" element casing as it matches the casing in the XML Schema and obviously the XML itself?
The text was updated successfully, but these errors were encountered: