-
-
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
remove useless classes in the generated models + use booleans instead of True False enum. #691
Comments
The name type is an root level element, by definition those are global types and can appear as standalone
Maybe I could add a config option to remove types with no dependencies that are not used anywhere could do the trick here. For the second on the enumeration extend the xs:NMTOKEN, there is no way to determine that these are actually boolean. |
Actually for the first one, I generated the output 2 weeks ago with I tried again yesterday but I couldn't reproduce the same result, I have no idea about the reason. would appreciate if you could add it as a config option. |
The |
Never mind, maybe I've commented out some elements. |
Is there a plan to add this as a config option? |
Yeap, it's planned |
Hi @amal-meer I added a new config option to specify the filter strategy Give it a try xsdata schema.xsd --filter-strategy referredGlobals |
Hello, I don't see this option anymore in v24.3, did I miss something on this topic? |
Since v24.3 the generator avoids flattening all root elements and global types, which also removed the filtering strategies. |
Thanks for the quick answer, does this new behavior correspond to one of the filter strategies that were available or the current behavior is completely new? |
There is no filter strategies anymore, all root elements and complex types are going to be generated. |
I have 2 things that I need to improve to simplify the generated classes from my xsd file. A sample to illustrate the issue:
Child1 is the ideal schema representation that will result in the needed output, but Child2 is the one that I have.
Problems:
The xsd file represents some strings attributes as a sequence of elements that refers to another element.
Ex:
Name
inChild2
element. This will results in an unnecessaryName
class and I will need to remove it manually.Some attributes are represented as a "Yes" and "No" enum, is there a way to convert such an attribute to boolean? and then parse it from the XML file as True if the value is Yes, and False if the value is No?
The text was updated successfully, but these errors were encountered: