lutaml-model 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/dependent-tests.yml +2 -0
- data/.rubocop_todo.yml +39 -13
- data/Gemfile +1 -0
- data/README.adoc +396 -23
- data/lib/lutaml/model/constants.rb +7 -0
- data/lib/lutaml/model/error/type/invalid_value_error.rb +19 -0
- data/lib/lutaml/model/error.rb +1 -0
- data/lib/lutaml/model/key_value_mapping.rb +31 -2
- data/lib/lutaml/model/mapping_hash.rb +8 -0
- data/lib/lutaml/model/mapping_rule.rb +4 -0
- data/lib/lutaml/model/schema/templates/simple_type.rb +247 -0
- data/lib/lutaml/model/schema/xml_compiler.rb +720 -0
- data/lib/lutaml/model/schema.rb +5 -0
- data/lib/lutaml/model/serialize.rb +24 -8
- data/lib/lutaml/model/toml_adapter/toml_rb_adapter.rb +1 -2
- data/lib/lutaml/model/type/hash.rb +11 -11
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +5 -1
- data/lib/lutaml/model/xml_adapter/xml_document.rb +11 -15
- data/lib/lutaml/model/xml_mapping.rb +4 -2
- data/lib/lutaml/model/xml_mapping_rule.rb +1 -4
- data/lib/lutaml/model.rb +1 -0
- data/spec/fixtures/xml/invalid_math_document.xml +4 -0
- data/spec/fixtures/xml/math_document_schema.xsd +56 -0
- data/spec/fixtures/xml/test_schema.xsd +53 -0
- data/spec/fixtures/xml/valid_math_document.xml +4 -0
- data/spec/lutaml/model/cdata_spec.rb +2 -2
- data/spec/lutaml/model/custom_model_spec.rb +7 -20
- data/spec/lutaml/model/key_value_mapping_spec.rb +27 -0
- data/spec/lutaml/model/map_all_spec.rb +188 -0
- data/spec/lutaml/model/mixed_content_spec.rb +15 -15
- data/spec/lutaml/model/schema/xml_compiler_spec.rb +1431 -0
- data/spec/lutaml/model/with_child_mapping_spec.rb +2 -2
- data/spec/lutaml/model/xml_adapter/xml_namespace_spec.rb +52 -0
- data/spec/lutaml/model/xml_mapping_spec.rb +108 -1
- metadata +12 -2
@@ -539,10 +539,10 @@ RSpec.describe "MixedContent" do
|
|
539
539
|
let(:expected_nokogiri_xml) do
|
540
540
|
<<~XML
|
541
541
|
<SpecialCharContentWithRawOptionAndMixedOption><special>
|
542
|
-
B
|
543
|
-
C
|
544
|
-
O
|
545
|
-
F
|
542
|
+
B <p>R&C</p>
|
543
|
+
C <p>J—C</p>
|
544
|
+
O <p>A & B </p>
|
545
|
+
F <p>Z ©S</p>
|
546
546
|
</special></SpecialCharContentWithRawOptionAndMixedOption>
|
547
547
|
XML
|
548
548
|
end
|
@@ -550,10 +550,10 @@ RSpec.describe "MixedContent" do
|
|
550
550
|
let(:expected_ox_xml) do
|
551
551
|
<<~XML
|
552
552
|
<SpecialCharContentWithRawOptionAndMixedOption>
|
553
|
-
<special> B
|
554
|
-
C
|
555
|
-
O
|
556
|
-
F
|
553
|
+
<special> B <p>R&C</p>
|
554
|
+
C <p>J—C</p>
|
555
|
+
O <p>A & B </p>
|
556
|
+
F <p>Z ©S</p>
|
557
557
|
</special>
|
558
558
|
</SpecialCharContentWithRawOptionAndMixedOption>
|
559
559
|
XML
|
@@ -562,10 +562,10 @@ RSpec.describe "MixedContent" do
|
|
562
562
|
let(:expected_oga_xml) do
|
563
563
|
<<~XML
|
564
564
|
<SpecialCharContentWithRawOptionAndMixedOption>
|
565
|
-
<special> B
|
566
|
-
C
|
567
|
-
O
|
568
|
-
F
|
565
|
+
<special> B <p>R&C</p>
|
566
|
+
C <p>J—C</p>
|
567
|
+
O <p>A & B </p>
|
568
|
+
F <p>Z ©S</p>
|
569
569
|
</special>
|
570
570
|
</SpecialCharContentWithRawOptionAndMixedOption>
|
571
571
|
XML
|
@@ -604,9 +604,9 @@ RSpec.describe "MixedContent" do
|
|
604
604
|
end
|
605
605
|
|
606
606
|
describe ".to_xml" do
|
607
|
-
let(:expected_nokogiri_xml) { "B
|
608
|
-
let(:expected_oga_xml) { "B
|
609
|
-
let(:expected_ox_xml) { "B
|
607
|
+
let(:expected_nokogiri_xml) { "B <p>R</p>" }
|
608
|
+
let(:expected_oga_xml) { "B <p>R&C</p>" }
|
609
|
+
let(:expected_ox_xml) { "B <p>R&C</p>" }
|
610
610
|
|
611
611
|
it "serializes special char mixed content correctly" do
|
612
612
|
parsed = MixedContentSpec::SpecialCharContentWithRawAndMixedOption.from_xml(xml)
|