lutaml-model 0.8.116 → 0.8.117
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 49af9f0bc6f8dd954e93d9d3ac641e212dbf526486c9c8a2eb3460ccfbf01cbf
|
|
4
|
+
data.tar.gz: cf20d264b0827b500c0dde7340b721c5ea89235341a55ef603f3e41dd461a31a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62359095df53c8835748e08c60c8648f6e07a4e892536da699ded2f255ec176a8aee3e648012d27e62909af5e34426118f465d93adf616ed005e22273e990fbc
|
|
7
|
+
data.tar.gz: 7e1d1f54a24252a44a31e2a0d45e878c13b9a5d44115a856aafd383cf24adb731ad585d52b8a8d9d648557ee150e2c0b776a1edd18b405bf16c79e76fbf4c2a8
|
data/lib/lutaml/model/version.rb
CHANGED
|
@@ -485,8 +485,12 @@ module Lutaml
|
|
|
485
485
|
# namespace). Contested names dispatch strictly by
|
|
486
486
|
# (URI, local), falling back to URI-less rows.
|
|
487
487
|
name = object.name
|
|
488
|
+
# Order entries may carry names with no mapped row (the
|
|
489
|
+
# parse records every child in document order); the
|
|
490
|
+
# layout cache kills its default proc to stay
|
|
491
|
+
# mutation-free, so a miss reads nil and drops below.
|
|
488
492
|
keys = name_keys[name]
|
|
489
|
-
if keys
|
|
493
|
+
if keys&.length == 1
|
|
490
494
|
dispatch_key = keys.first
|
|
491
495
|
entry = rows_by_name[dispatch_key]
|
|
492
496
|
else
|
|
@@ -516,6 +516,28 @@ RSpec.describe "XML plan fast path" do
|
|
|
516
516
|
expect(fast_out).to include(%(<para kind="a">Hi <emph>there</emph> bye <emph>again</emph>!</para>))
|
|
517
517
|
end
|
|
518
518
|
|
|
519
|
+
it "drops order entries whose names have no mapped row" do
|
|
520
|
+
klass = Class.new(Lutaml::Model::Serializable) do
|
|
521
|
+
attribute :a, :string, collection: true
|
|
522
|
+
|
|
523
|
+
xml do
|
|
524
|
+
element "d"
|
|
525
|
+
ordered
|
|
526
|
+
map_element "a", to: :a
|
|
527
|
+
end
|
|
528
|
+
end
|
|
529
|
+
xml = %(<d><a>1</a><note>extra</note><a>2</a></d>)
|
|
530
|
+
|
|
531
|
+
Lutaml::Model::Config.instance.xml_plan_fast_path = false
|
|
532
|
+
interp = klass.from_xml(xml).to_xml
|
|
533
|
+
Lutaml::Model::Config.instance.xml_plan_fast_path = true
|
|
534
|
+
fast_out = klass.from_xml(xml).to_xml
|
|
535
|
+
Lutaml::Model::Config.instance.xml_plan_fast_path = false
|
|
536
|
+
|
|
537
|
+
expect(fast_out).to eq(interp)
|
|
538
|
+
expect(fast_out).to eq("<d>\n <a>1</a>\n <a>2</a>\n</d>")
|
|
539
|
+
end
|
|
540
|
+
|
|
519
541
|
it "reflects content mutations through the ordered fast serializer" do
|
|
520
542
|
para = Class.new(Lutaml::Model::Serializable) do
|
|
521
543
|
attribute :emph, :string, collection: true
|