-
-
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
Separate naming schemes for field names and enum members #407
Comments
What version of xsdata are you using @untereiner ? <xsd:simpleType name="RootEnum">
<xsd:restriction>
<xsd:enumeration value="tested below and above" />
<xsd:enumeration value="non-intrusive" />
</xsd:restriction>
</xsd:simpleType> generates with xsdata v21.2 class RootEnum(Enum):
TESTED_BELOW_AND_ABOVE = "tested below and above"
NON_INTRUSIVE = "non-intrusive" |
with xsdata 21.2 in a venv: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="RootEnum">
<xsd:restriction base="xs:string">
<xsd:enumeration value="tested below and above" />
<xsd:enumeration value="non-intrusive" />
</xsd:restriction>
</xsd:simpleType> class RootEnum(Enum):
TESTEDBELOWANDABOVE = "tested below and above"
NONINTRUSIVE = "non-intrusive" |
Are you using a custom generator config? |
I have a .xdata.xml. It can be something with the aliases I did not understand <Conventions>
<ClassName case="pascalCase" safePrefix="type"/>
<FieldName case="camelCase" safePrefix="value"/>
<ModuleName case="snakeCase" safePrefix="mod"/>
<PackageName case="snakeCase" safePrefix="pkg"/>
</Conventions>
<Aliases>
<ClassName source="fooType" target="Foo"/>
<ClassName source="ABCSomething" target="ABCSomething"/>
<FieldName source="ChangeofGauge" target="changeOfGauge"/>
<PackageName source="http://www.w3.org/1999/xhtml" target="xtml"/>
<ModuleName source="2010.1" target="2020a"/>
</Aliases> |
Yeah that camel case on field names is messing up the constant name, which simply turns to upper the output of the field name callback. |
ok! is it possible to have the camelCase on the field name and an upper snake case for the enums field names ? |
yeah I am thinking we need a standalone convention config for constant names |
Closes #407 Notes: Downgrade sphinx there is some issue with 3.5.0
Notes: - Add screaming snake case scheme - Downgrade sphinx there is some issue with 3.5.0 - Closes #407
Notes: - Add screaming snake case scheme - Downgrade sphinx there is some issue with 3.5.0 - Closes #407
Thanks for reporting @untereiner I added a separate convention config for constant names and a new naming scheme |
The function
constant_name
doesn't handle values with spaces or dashes between words, exampleThe text was updated successfully, but these errors were encountered: