polyxml 0.23.0__tar.gz → 0.23.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polyxml-0.23.0 → polyxml-0.23.3}/Cargo.lock +35 -40
- {polyxml-0.23.0 → polyxml-0.23.3}/Cargo.toml +3 -3
- {polyxml-0.23.0 → polyxml-0.23.3}/PKG-INFO +5 -5
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/README.md +5 -5
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/cpp/mod.rs +2 -2
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/csharp/mod.rs +1 -1
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/go/mod.rs +2 -2
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/java/mod.rs +9 -9
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/python/mod.rs +1 -1
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/rust/mod.rs +1 -1
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/typescript/mod.rs +1 -1
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/transcoder.rs +4 -2
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_csharp_codegen.rs +8 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_python_codegen.rs +1 -1
- {polyxml-0.23.0 → polyxml-0.23.3}/pyproject.toml +5 -6
- {polyxml-0.23.0 → polyxml-0.23.3}/python/polyxml/__init__.py +1 -1
- {polyxml-0.23.0 → polyxml-0.23.3}/README.md +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/Cargo.toml +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/benches/core_benchmarks.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/benches/support/tag_dispatch_fixtures.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/benches/tag_dispatch.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/java/codec.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/java/models.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/codegen/mod.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/converters.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/error.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/ir/mod.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/ir/tarjan.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/json.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/lib.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/parser.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/schema.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/schema_parser/mod.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/serializer.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/src/value.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_conformance.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_core.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_cpp_codegen.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_go_codegen.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_java_codegen.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_json.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_pattern_codegen.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_rust_codecs.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_rust_codegen.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_schema_audit.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_schema_ir.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_security.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_transcoder.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_ts_codegen.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/tests/test_xsi_type.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/Cargo.toml +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/README.md +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/src/lib.rs +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/tests/test_conformance.py +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/tests/test_generated_models.py +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/tests/test_json.py +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/tests/test_polyxml.py +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-python/tests/test_xsi_type.py +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/python/polyxml/AGENT_GUIDE.md +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/python/polyxml/compat/__init__.py +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/python/polyxml/compat/xsdata.py +0 -0
- {polyxml-0.23.0 → polyxml-0.23.3}/python/polyxml/py.typed +0 -0
|
@@ -145,9 +145,9 @@ dependencies = [
|
|
|
145
145
|
|
|
146
146
|
[[package]]
|
|
147
147
|
name = "clap"
|
|
148
|
-
version = "4.6.
|
|
148
|
+
version = "4.6.7"
|
|
149
149
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
-
checksum = "
|
|
150
|
+
checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"
|
|
151
151
|
dependencies = [
|
|
152
152
|
"clap_builder",
|
|
153
153
|
"clap_derive",
|
|
@@ -155,9 +155,9 @@ dependencies = [
|
|
|
155
155
|
|
|
156
156
|
[[package]]
|
|
157
157
|
name = "clap_builder"
|
|
158
|
-
version = "4.6.
|
|
158
|
+
version = "4.6.7"
|
|
159
159
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
160
|
-
checksum = "
|
|
160
|
+
checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"
|
|
161
161
|
dependencies = [
|
|
162
162
|
"anstream",
|
|
163
163
|
"anstyle",
|
|
@@ -167,9 +167,9 @@ dependencies = [
|
|
|
167
167
|
|
|
168
168
|
[[package]]
|
|
169
169
|
name = "clap_derive"
|
|
170
|
-
version = "4.6.
|
|
170
|
+
version = "4.6.7"
|
|
171
171
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
172
|
-
checksum = "
|
|
172
|
+
checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0"
|
|
173
173
|
dependencies = [
|
|
174
174
|
"heck",
|
|
175
175
|
"proc-macro2",
|
|
@@ -474,9 +474,9 @@ dependencies = [
|
|
|
474
474
|
|
|
475
475
|
[[package]]
|
|
476
476
|
name = "napi-build"
|
|
477
|
-
version = "2.
|
|
477
|
+
version = "2.5.0"
|
|
478
478
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
479
|
-
checksum = "
|
|
479
|
+
checksum = "0941983559cd62bfa7f04646a16428967a847365adeef27711e4e3927046bbed"
|
|
480
480
|
|
|
481
481
|
[[package]]
|
|
482
482
|
name = "napi-derive"
|
|
@@ -608,7 +608,7 @@ dependencies = [
|
|
|
608
608
|
|
|
609
609
|
[[package]]
|
|
610
610
|
name = "polyxml"
|
|
611
|
-
version = "0.23.
|
|
611
|
+
version = "0.23.3"
|
|
612
612
|
dependencies = [
|
|
613
613
|
"criterion",
|
|
614
614
|
"heck",
|
|
@@ -628,14 +628,14 @@ dependencies = [
|
|
|
628
628
|
|
|
629
629
|
[[package]]
|
|
630
630
|
name = "polyxml-c"
|
|
631
|
-
version = "0.23.
|
|
631
|
+
version = "0.23.3"
|
|
632
632
|
dependencies = [
|
|
633
633
|
"polyxml",
|
|
634
634
|
]
|
|
635
635
|
|
|
636
636
|
[[package]]
|
|
637
637
|
name = "polyxml-cli"
|
|
638
|
-
version = "0.23.
|
|
638
|
+
version = "0.23.3"
|
|
639
639
|
dependencies = [
|
|
640
640
|
"clap",
|
|
641
641
|
"glob",
|
|
@@ -649,7 +649,7 @@ dependencies = [
|
|
|
649
649
|
|
|
650
650
|
[[package]]
|
|
651
651
|
name = "polyxml-js"
|
|
652
|
-
version = "0.23.
|
|
652
|
+
version = "0.23.3"
|
|
653
653
|
dependencies = [
|
|
654
654
|
"napi",
|
|
655
655
|
"napi-build",
|
|
@@ -659,7 +659,7 @@ dependencies = [
|
|
|
659
659
|
|
|
660
660
|
[[package]]
|
|
661
661
|
name = "polyxml-python"
|
|
662
|
-
version = "0.23.
|
|
662
|
+
version = "0.23.3"
|
|
663
663
|
dependencies = [
|
|
664
664
|
"lexical-core",
|
|
665
665
|
"polyxml",
|
|
@@ -669,7 +669,7 @@ dependencies = [
|
|
|
669
669
|
|
|
670
670
|
[[package]]
|
|
671
671
|
name = "polyxml-wasm"
|
|
672
|
-
version = "0.23.
|
|
672
|
+
version = "0.23.3"
|
|
673
673
|
dependencies = [
|
|
674
674
|
"polyxml",
|
|
675
675
|
"quick-xml",
|
|
@@ -891,11 +891,11 @@ dependencies = [
|
|
|
891
891
|
|
|
892
892
|
[[package]]
|
|
893
893
|
name = "serde_spanned"
|
|
894
|
-
version = "
|
|
894
|
+
version = "1.1.1"
|
|
895
895
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
896
|
-
checksum = "
|
|
896
|
+
checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
|
|
897
897
|
dependencies = [
|
|
898
|
-
"
|
|
898
|
+
"serde_core",
|
|
899
899
|
]
|
|
900
900
|
|
|
901
901
|
[[package]]
|
|
@@ -995,44 +995,42 @@ dependencies = [
|
|
|
995
995
|
|
|
996
996
|
[[package]]
|
|
997
997
|
name = "toml"
|
|
998
|
-
version = "
|
|
998
|
+
version = "1.1.6+spec-1.1.0"
|
|
999
999
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1000
|
-
checksum = "
|
|
1000
|
+
checksum = "920602543f0911ab71da12c50d59701da54c196d1a2bf5cb4b75667f137a406a"
|
|
1001
1001
|
dependencies = [
|
|
1002
|
-
"
|
|
1002
|
+
"indexmap",
|
|
1003
|
+
"serde_core",
|
|
1003
1004
|
"serde_spanned",
|
|
1004
1005
|
"toml_datetime",
|
|
1005
|
-
"
|
|
1006
|
+
"toml_parser",
|
|
1007
|
+
"toml_writer",
|
|
1008
|
+
"winnow",
|
|
1006
1009
|
]
|
|
1007
1010
|
|
|
1008
1011
|
[[package]]
|
|
1009
1012
|
name = "toml_datetime"
|
|
1010
|
-
version = "
|
|
1013
|
+
version = "1.1.1+spec-1.1.0"
|
|
1011
1014
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1012
|
-
checksum = "
|
|
1015
|
+
checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
|
|
1013
1016
|
dependencies = [
|
|
1014
|
-
"
|
|
1017
|
+
"serde_core",
|
|
1015
1018
|
]
|
|
1016
1019
|
|
|
1017
1020
|
[[package]]
|
|
1018
|
-
name = "
|
|
1019
|
-
version = "
|
|
1021
|
+
name = "toml_parser"
|
|
1022
|
+
version = "1.1.3+spec-1.1.0"
|
|
1020
1023
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1021
|
-
checksum = "
|
|
1024
|
+
checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"
|
|
1022
1025
|
dependencies = [
|
|
1023
|
-
"indexmap",
|
|
1024
|
-
"serde",
|
|
1025
|
-
"serde_spanned",
|
|
1026
|
-
"toml_datetime",
|
|
1027
|
-
"toml_write",
|
|
1028
1026
|
"winnow",
|
|
1029
1027
|
]
|
|
1030
1028
|
|
|
1031
1029
|
[[package]]
|
|
1032
|
-
name = "
|
|
1033
|
-
version = "
|
|
1030
|
+
name = "toml_writer"
|
|
1031
|
+
version = "1.1.2+spec-1.1.0"
|
|
1034
1032
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1035
|
-
checksum = "
|
|
1033
|
+
checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
|
|
1036
1034
|
|
|
1037
1035
|
[[package]]
|
|
1038
1036
|
name = "unicode-ident"
|
|
@@ -1155,12 +1153,9 @@ dependencies = [
|
|
|
1155
1153
|
|
|
1156
1154
|
[[package]]
|
|
1157
1155
|
name = "winnow"
|
|
1158
|
-
version = "0.
|
|
1156
|
+
version = "1.0.4"
|
|
1159
1157
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1160
|
-
checksum = "
|
|
1161
|
-
dependencies = [
|
|
1162
|
-
"memchr",
|
|
1163
|
-
]
|
|
1158
|
+
checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
|
|
1164
1159
|
|
|
1165
1160
|
[[package]]
|
|
1166
1161
|
name = "yansi"
|
|
@@ -3,13 +3,13 @@ resolver = "2"
|
|
|
3
3
|
members = ["crates/polyxml-core", "crates/polyxml-python"]
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
|
-
version = "0.23.
|
|
6
|
+
version = "0.23.3"
|
|
7
7
|
edition = "2021"
|
|
8
8
|
rust-version = "1.80"
|
|
9
9
|
license = "MIT"
|
|
10
10
|
authors = ["Bailey Nguyen <bailey.tan.nguyen@gmail.com>"]
|
|
11
|
-
repository = "https://github.com/
|
|
12
|
-
homepage = "https://github.
|
|
11
|
+
repository = "https://github.com/polyxml/PolyXML"
|
|
12
|
+
homepage = "https://polyxml.github.io/PolyXML/"
|
|
13
13
|
keywords = ["xml", "deserializer", "serializer", "data-binding", "polyglot"]
|
|
14
14
|
categories = ["parsing", "encoding"]
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyxml
|
|
3
|
-
Version: 0.23.
|
|
3
|
+
Version: 0.23.3
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -26,10 +26,10 @@ Author-email: Bailey Nguyen <bailey.tan.nguyen@gmail.com>
|
|
|
26
26
|
License: MIT
|
|
27
27
|
Requires-Python: >=3.12
|
|
28
28
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
29
|
-
Project-URL: Documentation, https://
|
|
30
|
-
Project-URL: Homepage, https://github.com/
|
|
31
|
-
Project-URL: Issues, https://github.com/
|
|
32
|
-
Project-URL: Repository, https://github.com/
|
|
29
|
+
Project-URL: Documentation, https://polyxml.github.io/PolyXML/
|
|
30
|
+
Project-URL: Homepage, https://github.com/polyxml/PolyXML
|
|
31
|
+
Project-URL: Issues, https://github.com/polyxml/PolyXML/issues
|
|
32
|
+
Project-URL: Repository, https://github.com/polyxml/PolyXML
|
|
33
33
|
|
|
34
34
|
# PolyXML Python Bindings
|
|
35
35
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://crates.io/crates/polyxml)
|
|
4
4
|
[](https://docs.rs/polyxml)
|
|
5
|
-
[](https://github.com/
|
|
5
|
+
[](https://github.com/polyxml/PolyXML/blob/main/LICENSE)
|
|
6
6
|
|
|
7
7
|
**PolyXML** is a high-performance streaming XML data-binding engine and polyglot schema compiler built in Rust. It serves as the foundational native core powering the `polyxml` CLI and language bindings across Python, C/C++, Java, TypeScript, Go, and C#.
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
- **Pure-Rust XSD 1.0 & 1.1 Schema Parser**: Parses complex schemas with full support for includes, imports, redefines, choice groups, and restriction facets with zero C dependencies.
|
|
15
15
|
- **Language-Agnostic Schema IR**: Normalizes XML Schema constructs into an actionable, unified Intermediate Representation (`SchemaIR`).
|
|
16
16
|
- **Tarjan SCC Cycle Analysis**: Automatically breaks recursive and mutually cyclic type references with minimal cut points (`Box<T>`, pointers, `std::unique_ptr`, `z.lazy`).
|
|
17
|
-
- **7-Target Code Generator**: Emits idiomatic models and streaming codecs for **Rust**, **Python** (dataclasses & Pydantic v2), **C++20**, **Java
|
|
17
|
+
- **7-Target Code Generator**: Emits idiomatic models and streaming codecs for **Rust**, **Python** (dataclasses & Pydantic v2), **C++20**, **Java 22+**, **TypeScript 5+**, **Go 1.22+**, and **C# 12 / .NET 8+**.
|
|
18
18
|
- **Bidirectional Streaming Codecs**: Fast streaming deserialization and serialization with optional indentation formatting and namespace mapping.
|
|
19
19
|
- **Security Hardened**: Built-in recursion depth limits protect against XML entity expansion and deeply nested denial-of-service (Billion Laughs) attacks.
|
|
20
20
|
- **Zero Heavy Allocations**: Uses `smallvec` and slice lookups to minimize intermediate heap allocations.
|
|
@@ -145,12 +145,12 @@ let val = polyxml::deserialize_with_limit(xml_bytes, schema, 64)?;
|
|
|
145
145
|
|
|
146
146
|
## Documentation & Repository
|
|
147
147
|
|
|
148
|
-
- **Full Documentation**: [https://
|
|
148
|
+
- **Full Documentation**: [https://polyxml.github.io/PolyXML/](https://polyxml.github.io/PolyXML/)
|
|
149
149
|
- **API Reference**: [https://docs.rs/polyxml](https://docs.rs/polyxml)
|
|
150
|
-
- **Source Code**: [https://github.com/
|
|
150
|
+
- **Source Code**: [https://github.com/polyxml/PolyXML](https://github.com/polyxml/PolyXML)
|
|
151
151
|
|
|
152
152
|
---
|
|
153
153
|
|
|
154
154
|
## License
|
|
155
155
|
|
|
156
|
-
Licensed under the [MIT License](https://github.com/
|
|
156
|
+
Licensed under the [MIT License](https://github.com/polyxml/PolyXML/blob/main/LICENSE).
|
|
@@ -268,7 +268,7 @@ impl CppCodegen {
|
|
|
268
268
|
}
|
|
269
269
|
writeln!(
|
|
270
270
|
out,
|
|
271
|
-
"// @generated by PolyXML Compiler (https://github.com/
|
|
271
|
+
"// @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)"
|
|
272
272
|
)
|
|
273
273
|
.unwrap();
|
|
274
274
|
writeln!(out, "// Target: Modern C++20/C++23 (Header-Only)").unwrap();
|
|
@@ -306,7 +306,7 @@ impl CppCodegen {
|
|
|
306
306
|
}
|
|
307
307
|
writeln!(
|
|
308
308
|
out,
|
|
309
|
-
"// @generated by PolyXML Compiler (https://github.com/
|
|
309
|
+
"// @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)"
|
|
310
310
|
)
|
|
311
311
|
.unwrap();
|
|
312
312
|
writeln!(out, "// Target: Modern C++20/C++23 Module Interface Unit").unwrap();
|
|
@@ -263,7 +263,7 @@ impl CSharpCodegen {
|
|
|
263
263
|
writeln!(out, "// <auto-generated/>").unwrap();
|
|
264
264
|
writeln!(
|
|
265
265
|
out,
|
|
266
|
-
"// @generated by PolyXML Compiler (https://github.com/
|
|
266
|
+
"// @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)"
|
|
267
267
|
)
|
|
268
268
|
.unwrap();
|
|
269
269
|
writeln!(out, "#nullable enable\n").unwrap();
|
|
@@ -316,12 +316,12 @@ impl GoCodegen {
|
|
|
316
316
|
}
|
|
317
317
|
writeln!(
|
|
318
318
|
out,
|
|
319
|
-
"// Code generated by PolyXML Compiler (https://github.com/
|
|
319
|
+
"// Code generated by PolyXML Compiler (https://github.com/polyxml/PolyXML). DO NOT EDIT."
|
|
320
320
|
)
|
|
321
321
|
.unwrap();
|
|
322
322
|
writeln!(
|
|
323
323
|
out,
|
|
324
|
-
"// @generated by PolyXML Compiler (https://github.com/
|
|
324
|
+
"// @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)\n"
|
|
325
325
|
)
|
|
326
326
|
.unwrap();
|
|
327
327
|
|
|
@@ -18,7 +18,7 @@ use crate::ir::{
|
|
|
18
18
|
/// Target backend for Java code emission.
|
|
19
19
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
|
|
20
20
|
pub enum JavaBackend {
|
|
21
|
-
/// Zero-dependency Java
|
|
21
|
+
/// Zero-dependency Java 22+ records (default).
|
|
22
22
|
#[default]
|
|
23
23
|
Standard,
|
|
24
24
|
/// Jackson-annotated records for Spring Boot / enterprise JSON+XML binding.
|
|
@@ -39,14 +39,14 @@ impl JavaBackend {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
/// Options configuring Java
|
|
42
|
+
/// Options configuring Java 22+ code generation.
|
|
43
43
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
44
44
|
pub struct JavaOptions {
|
|
45
45
|
/// Java package declaration for generated types (default: "generated.models")
|
|
46
46
|
pub package_name: String,
|
|
47
47
|
/// Target serialization backend (default: Standard / zero-dependency).
|
|
48
48
|
pub backend: JavaBackend,
|
|
49
|
-
/// Use Java
|
|
49
|
+
/// Use Java 22 `record` instead of traditional classes (default: true)
|
|
50
50
|
pub use_records: bool,
|
|
51
51
|
/// Emit fluent builders for model types.
|
|
52
52
|
#[serde(default)]
|
|
@@ -77,7 +77,7 @@ impl Default for JavaOptions {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
/// Language context adapter for Java
|
|
80
|
+
/// Language context adapter for Java 22+.
|
|
81
81
|
pub struct JavaLanguageContext;
|
|
82
82
|
|
|
83
83
|
impl LanguageContext for JavaLanguageContext {
|
|
@@ -226,7 +226,7 @@ pub fn to_java_enum_constant(name: &str) -> String {
|
|
|
226
226
|
sanitize_keyword(&sanitized, "java")
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
/// Code generator producing Java
|
|
229
|
+
/// Code generator producing Java 22+ records or mutable classes, choices, and enums.
|
|
230
230
|
pub struct JavaCodegen {
|
|
231
231
|
pub options: JavaOptions,
|
|
232
232
|
pub context: JavaLanguageContext,
|
|
@@ -323,13 +323,13 @@ impl JavaCodegen {
|
|
|
323
323
|
out.push_str("\n\n");
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
out.push_str("// @generated by PolyXML Compiler (https://github.com/
|
|
326
|
+
out.push_str("// @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)\n");
|
|
327
327
|
if !self.options.use_records {
|
|
328
|
-
out.push_str("// Target: Java
|
|
328
|
+
out.push_str("// Target: Java 22+ (Mutable JavaBeans)\n\n");
|
|
329
329
|
} else if self.options.backend.is_jackson() {
|
|
330
|
-
out.push_str("// Target: Java
|
|
330
|
+
out.push_str("// Target: Java 22+ (Records, Jackson XML/JSON Annotations)\n\n");
|
|
331
331
|
} else {
|
|
332
|
-
out.push_str("// Target: Java
|
|
332
|
+
out.push_str("// Target: Java 22+ (Records, Sealed Interfaces, Pattern Matching)\n\n");
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
if !self.options.package_name.is_empty() {
|
|
@@ -247,7 +247,7 @@ impl PythonCodegen {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
out.push_str("# @generated by PolyXML Compiler (https://github.com/
|
|
250
|
+
out.push_str("# @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)\n");
|
|
251
251
|
out.push_str("from __future__ import annotations\n\n");
|
|
252
252
|
|
|
253
253
|
self.emit_imports(&mut out, ir);
|
|
@@ -230,7 +230,7 @@ impl RustCodegen {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
out.push_str("// @generated by PolyXML Compiler (https://github.com/
|
|
233
|
+
out.push_str("// @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)\n");
|
|
234
234
|
out.push_str(
|
|
235
235
|
"#![allow(dead_code, unused_imports, unused_mut, unused_variables, unused_assignments, non_camel_case_types, non_snake_case)]\n\n",
|
|
236
236
|
);
|
|
@@ -262,7 +262,7 @@ impl TypeScriptCodegen {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
out.push_str("/**\n");
|
|
265
|
-
out.push_str(" * @generated by PolyXML Compiler (https://github.com/
|
|
265
|
+
out.push_str(" * @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)\n");
|
|
266
266
|
out.push_str(" * Target: TypeScript 5+\n");
|
|
267
267
|
if let Some(ref ns) = ir.target_namespace {
|
|
268
268
|
let _ = writeln!(out, " * Target Namespace: {}", ns);
|
|
@@ -16,7 +16,8 @@ use crate::serializer::XmlSerializer;
|
|
|
16
16
|
///
|
|
17
17
|
/// If a `ModelSchema` is provided, typed data-binding is used, respecting numeric, boolean,
|
|
18
18
|
/// and collection types as well as field aliases.
|
|
19
|
-
/// If `schema` is None,
|
|
19
|
+
/// If `schema` is None, XML events are assembled into a JSON value tree.
|
|
20
|
+
/// The complete input and output are held in memory.
|
|
20
21
|
pub fn xml_to_json(
|
|
21
22
|
xml: &[u8],
|
|
22
23
|
schema: Option<Arc<ModelSchema>>,
|
|
@@ -35,7 +36,8 @@ pub fn xml_to_json(
|
|
|
35
36
|
///
|
|
36
37
|
/// If a `ModelSchema` is provided, typed data-binding is used, mapping JSON properties to XML
|
|
37
38
|
/// elements, attributes, and namespaces.
|
|
38
|
-
/// If `schema` is None,
|
|
39
|
+
/// If `schema` is None, the complete JSON input is parsed into a value tree
|
|
40
|
+
/// before XML output is written into a byte buffer.
|
|
39
41
|
pub fn json_to_xml(
|
|
40
42
|
json: &[u8],
|
|
41
43
|
schema: Option<Arc<ModelSchema>>,
|
|
@@ -9,8 +9,11 @@ use polyxml::ir::{
|
|
|
9
9
|
Cardinality, EnumDef, EnumValue, FieldDef, FieldKind, PrimitiveType, QName, RestrictionFacets,
|
|
10
10
|
SchemaIR, StructDef, TypeDef, TypeRef, UnionBranch, UnionDef,
|
|
11
11
|
};
|
|
12
|
+
use std::sync::Mutex;
|
|
12
13
|
use tempfile::tempdir;
|
|
13
14
|
|
|
15
|
+
static DOTNET_LOCK: Mutex<()> = Mutex::new(());
|
|
16
|
+
|
|
14
17
|
fn dotnet_command() -> Command {
|
|
15
18
|
let mut cmd = Command::new("dotnet");
|
|
16
19
|
cmd.env("DOTNET_NOLOGO", "1");
|
|
@@ -317,6 +320,7 @@ public class Program
|
|
|
317
320
|
)
|
|
318
321
|
.unwrap();
|
|
319
322
|
|
|
323
|
+
let _dotnet_lock = DOTNET_LOCK.lock().unwrap();
|
|
320
324
|
let build_status = dotnet_command()
|
|
321
325
|
.args(["build", "--warnaserror"])
|
|
322
326
|
.current_dir(temp.path())
|
|
@@ -497,6 +501,7 @@ public class Program
|
|
|
497
501
|
)
|
|
498
502
|
.unwrap();
|
|
499
503
|
|
|
504
|
+
let _dotnet_lock = DOTNET_LOCK.lock().unwrap();
|
|
500
505
|
let build_status = dotnet_command()
|
|
501
506
|
.args(["build", "--warnaserror"])
|
|
502
507
|
.current_dir(temp.path())
|
|
@@ -639,6 +644,7 @@ public class Program
|
|
|
639
644
|
)
|
|
640
645
|
.unwrap();
|
|
641
646
|
|
|
647
|
+
let _dotnet_lock = DOTNET_LOCK.lock().unwrap();
|
|
642
648
|
let build_status = dotnet_command()
|
|
643
649
|
.args(["build", "--warnaserror"])
|
|
644
650
|
.current_dir(temp.path())
|
|
@@ -809,6 +815,7 @@ class Program {
|
|
|
809
815
|
if (((Greeting)gs.Deserialize(new StringReader(gw.ToString()))!).Value != "hello") throw new Exception(gw.ToString());
|
|
810
816
|
}
|
|
811
817
|
}"#).unwrap();
|
|
818
|
+
let _dotnet_lock = DOTNET_LOCK.lock().unwrap();
|
|
812
819
|
if Command::new("dotnet").arg("--version").output().is_err() {
|
|
813
820
|
return;
|
|
814
821
|
}
|
|
@@ -856,6 +863,7 @@ class Program { static void Main() {
|
|
|
856
863
|
if(((Root)rx.Deserialize(new StringReader(rw.ToString()))!).Value is not Contact.Phone) throw new Exception(rw.ToString());
|
|
857
864
|
} }
|
|
858
865
|
"#).unwrap();
|
|
866
|
+
let _dotnet_lock = DOTNET_LOCK.lock().unwrap();
|
|
859
867
|
if Command::new("dotnet").arg("--version").output().is_err() {
|
|
860
868
|
return;
|
|
861
869
|
}
|
|
@@ -422,7 +422,7 @@ fn test_python_generated_tag_and_custom_header() {
|
|
|
422
422
|
let default_codegen = PythonCodegen::new(PythonOptions::default());
|
|
423
423
|
let default_code = default_codegen.generate_module(&ir);
|
|
424
424
|
assert!(default_code
|
|
425
|
-
.contains("# @generated by PolyXML Compiler (https://github.com/
|
|
425
|
+
.contains("# @generated by PolyXML Compiler (https://github.com/polyxml/PolyXML)"));
|
|
426
426
|
assert!(default_code.contains("from __future__ import annotations"));
|
|
427
427
|
|
|
428
428
|
// With custom header: prepends custom header
|
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "polyxml"
|
|
7
|
-
version = "0.23.
|
|
7
|
+
version = "0.23.3"
|
|
8
8
|
description = "High-performance, polyglot XML data-binding engine built in Rust"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Bailey Nguyen", email = "bailey.tan.nguyen@gmail.com" }
|
|
@@ -41,10 +41,10 @@ dev = [
|
|
|
41
41
|
]
|
|
42
42
|
|
|
43
43
|
[project.urls]
|
|
44
|
-
Homepage = "https://github.com/
|
|
45
|
-
Documentation = "https://
|
|
46
|
-
Repository = "https://github.com/
|
|
47
|
-
Issues = "https://github.com/
|
|
44
|
+
Homepage = "https://github.com/polyxml/PolyXML"
|
|
45
|
+
Documentation = "https://polyxml.github.io/PolyXML/"
|
|
46
|
+
Repository = "https://github.com/polyxml/PolyXML"
|
|
47
|
+
Issues = "https://github.com/polyxml/PolyXML/issues"
|
|
48
48
|
|
|
49
49
|
[tool.maturin]
|
|
50
50
|
features = ["pyo3/extension-module"]
|
|
@@ -86,4 +86,3 @@ ignore = [
|
|
|
86
86
|
|
|
87
87
|
[tool.ruff.lint.isort]
|
|
88
88
|
known-first-party = ["polyxml"]
|
|
89
|
-
|
|
@@ -21,7 +21,7 @@ QUICKSTART FOR AI AGENTS & DEVELOPERS:
|
|
|
21
21
|
3. Serialize a model instance back into XML bytes:
|
|
22
22
|
>>> xml_bytes = polyxml.serialize(user, indent=2)
|
|
23
23
|
|
|
24
|
-
See `AGENT_GUIDE.md` or https://
|
|
24
|
+
See `AGENT_GUIDE.md` or https://polyxml.github.io/PolyXML/ for complete documentation.
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
import importlib
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polyxml-0.23.0 → polyxml-0.23.3}/crates/polyxml-core/benches/support/tag_dispatch_fixtures.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|