Comments (4)
Give it a try @hoehrmann and if you find anything else, feel free to open another issue
from xsdata.
Thanks for reporting @hoehrmann, I just tried it with the latest main and seems to be working just fine,
There is an issue with this month's release v24.3 and v24.3.1.
Untracked files:
(use "git add ..." to include in what will be committed)
foo.py
generated/
nothing added to commit but untracked files present (use "git add" to track)
❯ xsdata https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXMessage.xsd
========= xsdata v24.3.1 / Python 3.11.8 / Platform linux =========
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXMessage.xsd
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXMessageFooter.xsd
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXCommon.xsd
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/xml.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/xml.xsd
Builder: 4 main and 1 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXCommonReferences.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXCommonReferences.xsd
Builder: 168 main and 0 inner classes
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXCommon.xsd
Builder: 76 main and 0 inner classes
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXMessageFooter.xsd
Builder: 4 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructure.xsd
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureBase.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureBase.xsd
Builder: 23 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureCategorisation.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureCategorisation.xsd
Builder: 2 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureCategory.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureCategory.xsd
Builder: 3 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureCodelist.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureCodelist.xsd
Builder: 23 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureConcept.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureConcept.xsd
Builder: 6 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureConstraint.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureConstraint.xsd
Builder: 34 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureDataStructure.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureDataStructure.xsd
Builder: 43 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureDataflow.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureDataflow.xsd
Builder: 1 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureHierarchicalCodelist.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureHierarchicalCodelist.xsd
Builder: 10 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureMetadataflow.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureMetadataflow.xsd
Builder: 2 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureMetadataStructure.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureMetadataStructure.xsd
Builder: 10 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureOrganisation.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureOrganisation.xsd
Builder: 21 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureProvisionAgreement.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureProvisionAgreement.xsd
Builder: 4 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureProcess.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureProcess.xsd
Builder: 8 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureReportingTaxonomy.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureReportingTaxonomy.xsd
Builder: 4 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureStructureMappings.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureStructureMappings.xsd
Builder: 24 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureTransformation.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructureTransformation.xsd
Builder: 36 main and 0 inner classes
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXStructure.xsd
Builder: 38 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistry.xsd
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistryBase.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistryBase.xsd
Builder: 12 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistryRegistration.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistryRegistration.xsd
Builder: 9 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistryStructure.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistryStructure.xsd
Builder: 4 main and 0 inner classes
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistrySubscription.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistrySubscription.xsd
Builder: 19 main and 0 inner classes
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXRegistry.xsd
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXDataStructureSpecific.xsd
Parsing schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXMetadataGeneric.xsd
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXMetadataGeneric.xsd
Builder: 4 main and 0 inner classes
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXDataStructureSpecific.xsd
Builder: 7 main and 0 inner classes
Compiling schema https://raw.githubusercontent.com/sdmx-twg/sdmx-ml/29f1a3d856c4259429f5ec0eae811653adc5cdb5/schemas/SDMXMessage.xsd
Builder: 24 main and 0 inner classes
Analyzer input: 623 main and 1 inner classes
Analyzer output: 406 main and 0 inner classes
Generating package: init
Generating package: generated.sdmxcommon_references
Generating package: generated.sdmxcommon
Generating package: generated.sdmxmessage_footer
Generating package: generated.sdmxstructure_base
Generating package: generated.sdmxstructure_categorisation
Generating package: generated.sdmxstructure_category
Generating package: generated.sdmxstructure_codelist
Generating package: generated.sdmxstructure_concept
Generating package: generated.sdmxstructure_constraint
Generating package: generated.sdmxstructure_data_structure
Generating package: generated.sdmxstructure_dataflow
Generating package: generated.sdmxstructure_hierarchical_codelist
Generating package: generated.sdmxstructure_metadataflow
Generating package: generated.sdmxstructure_metadata_structure
Generating package: generated.sdmxstructure_organisation
Generating package: generated.sdmxstructure_provision_agreement
Generating package: generated.sdmxstructure_process
Generating package: generated.sdmxstructure_reporting_taxonomy
Generating package: generated.sdmxstructure_structure_mappings
Generating package: generated.sdmxstructure_transformation
Generating package: generated.sdmxstructure
Generating package: generated.sdmxregistry_base
Generating package: generated.sdmxregistry_registration
Generating package: generated.sdmxregistry_structure
Generating package: generated.sdmxregistry_subscription
Generating package: generated.sdmxmetadata_generic
Generating package: generated.sdmxdata_structure_specific
Generating package: generated.sdmxmessage
from xsdata.
Okay, and thanks for the quick reaction!
FWIW:
The schema might be an interesting test case for xsdata
, the generated code cannot be loaded due to circular imports, and some of the code looks a bit weird (though as a first time user I have no reference for what to expect). I suspect the schema is a bit unusual because they also derive a JSON Schema from it. The pattern that causes the circular import is a base type that is a union of foo: list-of-foo
, bar: list-of-bar
, ...
and then there are Foo
and Bar
that derive from the base and restrict it to their corresponding list (so the base type needs the derived types, and the derived types need the base, hence a circular reference). The properties could be erased from the base, they never really exist there. This might also be causing some Any
s that seem odd to me.
from xsdata.
At the moment xsdata doesn't know if the generated code has circular imports, but it comes with different structure styles that can resolve this issue.
I took the liberty to add the suite in the samples repo, I used clusters
and that took care of the circular import issues, there were a few issues that were resolved here
You can check it here, with some notes about some further limitations with mypy
https://github.com/tefra/xsdata-samples/tree/main/sdmx_ml, check the .xsdata.xml config I used
from xsdata.
Related Issues (20)
- SOAP: Stubs are not generated for most operations in EJBCA WSDL HOT 2
- I would like to write huge trees but don't retain the entire tree in memory HOT 4
- Simultaneous parsing sometimes causes "ConverterWarning: Failed to convert value" HOT 4
- xsdata generate file.xsd fails: AttrsFilters.field_definition() missing 1 required positional argument HOT 2
- Cannot generate nested group references with --unnest-classes HOT 1
- Calls to Ruff format/check fail on Windows for large document sets HOT 3
- Question: Ability to add ` field(repr=False)` for specific fields? HOT 2
- Please bring back support for optional lists HOT 2
- schema check on root element HOT 2
- xsdata failing to generate models for XJustiz XSDs - "missing closing quote in string literal" HOT 2
- XML parsing approximately 200 times slower than parsing to in-built xml.etree.ElementTree.Element HOT 5
- Generation raises and index out of range when not all includes are provided HOT 4
- Compatibility issue with `ruff-0.5.0`: ruff <path> has been removed HOT 2
- A way to not output tags with nillable="true" and minOccurs="0" ? HOT 4
- XmlDuration def to_timedelta HOT 2
- Split choice elements into virtual attributes HOT 3
- Parsing JSON schema ends in not expected result HOT 3
- Compound Fields only for Iterables HOT 4
- Support of dict types
- type evaluation needs to be updated for python 3.13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xsdata.