Add pydantic-xml model generation, XML schema validation tests, and CI workflow - #94
Conversation
Test Results1 tests +1 0 ✅ ±0 0s ⏱️ ±0s For more details on these errors, see this check. Results for commit 0fb7728. ± Comparison against base commit bc613d1. ♻️ This comment has been updated with latest results. |
…y tests Co-authored-by: pahjbo <273267+pahjbo@users.noreply.github.com>
…gnore Co-authored-by: pahjbo <273267+pahjbo@users.noreply.github.com>
… errors Co-authored-by: pahjbo <273267+pahjbo@users.noreply.github.com>
Added
Run with: |
… GitHub Actions workflow Co-authored-by: pahjbo <273267+pahjbo@users.noreply.github.com>
accepting them, as they are at least trying to deal with namespaces - however it looks like CO-PILOT is struggling - I think it will be necessary to go back to human research
python 3.14
xsdata seems to be be trying harder to be XML compliant
… wrong still do need proper reference handling though
|
not complete
…ent ID/IDREF auto processing
|
Am now adopting a different strategy to get the XML serialization parity with Java - am trying to get the ID/IDREF functionality implemented within xsdata rather than layered on top. (see tefra/xsdata#1222) |
also correct the key metadata
have copied the main json handling from xsdata to the python runtime to allow for detailed customization
…lization # Conflicts: # .gitignore # tools/gradletooling/sample/interoperability/java/jpatest.xml # tools/gradletooling/sample/interoperability/java/lifecycle.xml # tools/gradletooling/sample/interoperability/java/notstccoords.json # tools/gradletooling/sample/interoperability/java/notstccoords.xml # tools/gradletooling/sample/interoperability/java/sample.xml # tools/gradletooling/sample/interoperability/java/serializationsample.json # tools/gradletooling/sample/interoperability/java/serializationsample.xml
would be nice to include subsetting in future if possible.
the references are hard-wired - this is undesirable in general, but done to make progress on the serialization.
also realigning wrapping with java
… not using the pydantic json functions, but the ones in vodml_runtime.xsdata * will only work with modified xsdata - see tefra/xsdata#1222 * will only work for the "wrapped" VO-DML polymorphism style. * there is still probably some cruft to remove from the vodml_runtime.xsdata classes, as the starting point was the general equivalent classes from xsdata itself
|
|
This has had quite a bit of non-AI input as well, and although it is not completely passing tests, I am going to merge as there are some changes to the java side that need to be incorporated going forward too |



Adds a new Gradle task
vodmlPydanticGeneratethat transforms VO-DML models into Python pydantic-xml classes for XML/JSON serialisation without SQLAlchemy coupling, backed by interoperability tests and a dedicated CI workflow.XSLT generator —
tools/xslt/vo-dml2pydantic.xslobjectType/dataType→BaseXmlModelsubclasses withelement()field descriptorsenumeration→str, Enum;primitiveType→ single-field wrapperbinding_setup.xsland all existing binding/mapping infrastructuremaxOccurshandling vianumber()/string comparison (avoidsxsd:int()failures onunbounded)Gradle plugin —
VodmlPydanticTask.kt/VodmlGradlePlugin.ktVodmlPydanticTaskmirrorsVodmlPythonTask, sharingoutputPythonDirvodmlPydanticGenerateregistered alongside existing generation tasksPython interoperability tests —
PydanticInteropTest.pySampleModelInteropTest,LifecycleModelInteropTest,SerializationExampleInteropTest: construct the same object graphs as the Java tests, serialise to XML/JSON, write tointeroperability/python/, assert round-trip fidelityJavaInteropReadTest: reads Java-produced JSON and XML frominteroperability/java/, validates structure and field values, and schema-validates each XML against its generated XSD usinglxmlSchema validation of Python-generated XML is deferred until the pending namespace/
xsi:typegeneration fixes land.Build wiring
pytestPydantictask depends on bothvodmlPydanticGenerateandvodmlSchema(ensures XSD files are present before tests run)--junit-xmlflag added to the pytest command for CI result ingestionpydantic-xml==2.13.1added to the sample virtualenv pip dependenciesCI —
.github/workflows/pydantic-test.ymlDedicated workflow on push/PR to
main. Uses explicit step ordering to work around Gradle composite-build task-dependency limitations (the rootbuild.gradle.ktsalready notes this constraint):interoperability/java/fixtures./gradlew :ivoa:vodmlPydanticGenerate :sample:pytestPydanticEnricoMi/publish-unit-test-result-actionOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.