-
-
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
Missing SimpleType with xsdata 21.12 compared to 21.11 #643
Comments
Some more tests, as I think the issue comes from #629 xsd_1, 2 and 3 and in 3 different folders. When I call xsdata generate on xsd_2 folder, the python class for xsd_1 contains SimpleType A and not B If the change is really related to the issue 629, we will have to stick to xsdata 21.11, as I didn't see any option to maintain the old behavior |
Can you please create a sample xsd or post an excerpt? Send me an email @pcasenove |
I came down to a pretty simple example attached, showing the difference between 21.11 and 21.12. In "dict" folder, a simple ins.xsd file, defining 3 simple types (type1, type2 and type 3). Only type 1 is used in a ComplexType ctype1. And if you create a foo.xsd, with a complexType ctype2, using type 2 from ins.xsd (not in the archive), you get: |
I see, if those enumerations are not used in the models why are they necessary? As part of #629 all unused types were blocked from generation. |
In fact the enumerations are defined in the top ins.xsd file, but not used in it. The file is then imported in other xsd, using one of those enumerations when they need one of those. |
The cli doesn't check for usages only in the current xsd, it should have created those types if there was at least once occurence. I know it's a private project @pcasenove but I need the original schemas or an excerpt that I can use to reproduce the issue. email: chris@komposta.net |
And I forgot another detail: the xsd are in different folders, so as xsdata is not going through folders, it also explain the issue we have |
Oh I see so you are running the cli command multiple times? Have you tried using the command with input source the whole directory?
|
Yes we run it multiple times, on each folder. We can't put all files in a single directory because the import are done using relative paths. It would require massive changes or inline sed. |
If I give the top folder, it just does nothing:
And as I said, we can't move all xsd in a single folder. I'll send you the whole schemas by email |
xsdata architecture is to parse the complete schema definitions and then start analyzing, it's the only way to produce trully valid results. You are right the cli looks for any xsd files in the root of the input dir. Can you please give it another try with this update #644? I enabled the recursive globs for the files finder. $ xsdata generate issue/schemas/ST_DM_Schema/ -ss namespaces ...
Builder: 4 main and 0 inner classes
Analyzer input: 2283 main and 0 inner classes
Analyzer output: 2183 main and 0 inner classes
Generating package: init
Generating package: init
Generating package: init
.... |
Thanks a lot!!! That's great and much easier to generate now :) |
Awesome! I still have to add some unit tests, but that's it I will try to release a new version this weekend |
Thanks for reporting @pcasenove the new recursive mode will be available with the cli flag |
Hi,
Compared to xsdata 21.11, when generating bindings from XSD using 21.12, some SimpleTypes are missing in the generated class.
The XSD set of files are not public, so I can't easily share those; but did something change in the generation code between 21.11 and 21.12?
I've noticed that the 2 simple types that were not generated anymore where not included in ComplexType in the same XSD (but they are included in ComplexTYpes in others XSD that include this one)
Thanks,
The text was updated successfully, but these errors were encountered: