Xsd-parser v1.6.0 Release - Rust code generator for XML schemas

2026-11-05来源 Rust Users ForumEnglish
Xsd-parser v1.6.0 Release - Rust code generator for XML schemas

Hey everyone :wave:

I just released xsd-parser v1.6.0 (and xsd-parser-types v0.3.0)!

For those who don't know it yet: xsd-parser generates Rust types from XML schemas (XSD), optionally including quick_xml or serde (de)serialization code. The previous announcements can be found in the old thread.

This release brings some long requested features and a lot of fixes for real-world schemas:

  • Proper support for dynamic and abstract types: Abstract types and types used via xsi:type are now generated as dynamic types, also in combination with substitution groups.
  • Opt-in skipping of unknown elements: The quick_xml deserializer can now skip elements that are not part of the schema, including their whole subtree. Known elements at the wrong position still fail, so you don't silently lose data.
  • Types for binary data: xs:base64Binary and xs:hexBinary get dedicated types, and length facets are checked against the decoded data.
  • Upgrade to quick-xml 0.42, plus all other dependencies.
  • Custom generator code: Custom types can run their own code when the generator processes them.
  • Content helpers: A new render step generates accessor methods for flattened content.
  • Shared content types: Complex types with the same content now share one generated type instead of getting a copy each.
  • Better errors: Many panics were replaced by proper errors that name the affected type or file, and name collisions in the generated code are reported instead of producing code that does not compile.
  • Lots of fixes for patterns across derivation steps, substitution groups, forward references, newtypes, default values, namespaces and more.

There are a few breaking changes (mainly the quick-xml upgrade in xsd-parser-types, a new field in RenderStep::QuickXmlDeserialize and stricter pattern validation), so please have a look at the changelog before upgrading.

The README now also has a Getting Started section with a list of common pitfalls, and there is a new contributing guide.

A big thank you to everyone who reported issues, sent pull requests or shared their schemas. This release would not have been possible without you :heart:

As always, feedback and ideas are very welcome!

1 post - 1 participant

Read full topic

原文:https://www.a8q9.cn/en/article/xsd-parser-v1-6-0-release-rust-code-generator-for-xml-schemas-98aace.html

相关文章