lutaml-model 0.5.0 → 0.5.1
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 +4 -4
 - data/.rubocop_todo.yml +4 -4
 - data/README.adoc +837 -184
 - data/lib/lutaml/model/attribute.rb +6 -2
 - data/lib/lutaml/model/error/collection_true_missing_error.rb +16 -0
 - data/lib/lutaml/model/error/multiple_mappings_error.rb +6 -0
 - data/lib/lutaml/model/error.rb +2 -0
 - data/lib/lutaml/model/key_value_mapping.rb +26 -4
 - data/lib/lutaml/model/key_value_mapping_rule.rb +15 -4
 - data/lib/lutaml/model/loggable.rb +15 -0
 - data/lib/lutaml/model/mapping_rule.rb +2 -2
 - data/lib/lutaml/model/serialize.rb +50 -15
 - data/lib/lutaml/model/version.rb +1 -1
 - data/lib/lutaml/model/xml_adapter/xml_document.rb +3 -3
 - data/lib/lutaml/model/xml_mapping.rb +4 -0
 - data/lib/lutaml/model/xml_mapping_rule.rb +2 -5
 - data/lib/lutaml/model.rb +1 -0
 - data/spec/lutaml/model/root_mappings_spec.rb +297 -0
 - data/spec/lutaml/model/serializable_spec.rb +41 -6
 - data/spec/lutaml/model/with_child_mapping_spec.rb +182 -0
 - data/spec/lutaml/model/xml_adapter/xml_namespace_spec.rb +66 -0
 - data/spec/lutaml/model/xml_mapping_spec.rb +8 -0
 - metadata +6 -2
 
| 
         @@ -620,6 +620,14 @@ RSpec.describe Lutaml::Model::XmlMapping do 
     | 
|
| 
       620 
620 
     | 
    
         
             
                    it "contain schemaLocation attributes" do
         
     | 
| 
       621 
621 
     | 
    
         
             
                      expect(Paragraph.from_xml(xml).to_xml).to be_equivalent_to(xml)
         
     | 
| 
       622 
622 
     | 
    
         
             
                    end
         
     | 
| 
      
 623 
     | 
    
         
            +
             
     | 
| 
      
 624 
     | 
    
         
            +
                    it "prints warning if defined explicitly in class" do
         
     | 
| 
      
 625 
     | 
    
         
            +
                      error_regex = /\[Lutaml::Model\] WARN: `schemaLocation` is handled by default\. No need to explecitly define at `xml_mapping_spec.rb:\d+`/
         
     | 
| 
      
 626 
     | 
    
         
            +
             
     | 
| 
      
 627 
     | 
    
         
            +
                      expect do
         
     | 
| 
      
 628 
     | 
    
         
            +
                        Lutaml::Model::XmlMapping.new.map_attribute("schemaLocation", to: :schema_location)
         
     | 
| 
      
 629 
     | 
    
         
            +
                      end.to output(error_regex).to_stderr
         
     | 
| 
      
 630 
     | 
    
         
            +
                    end
         
     | 
| 
       623 
631 
     | 
    
         
             
                  end
         
     | 
| 
       624 
632 
     | 
    
         | 
| 
       625 
633 
     | 
    
         
             
                  context "when mixed: true" do
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: lutaml-model
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.5. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.5.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ribose Inc.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2025-01- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-01-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: thor
         
     | 
| 
         @@ -59,8 +59,10 @@ files: 
     | 
|
| 
       59 
59 
     | 
    
         
             
            - lib/lutaml/model/config.rb
         
     | 
| 
       60 
60 
     | 
    
         
             
            - lib/lutaml/model/error.rb
         
     | 
| 
       61 
61 
     | 
    
         
             
            - lib/lutaml/model/error/collection_count_out_of_range_error.rb
         
     | 
| 
      
 62 
     | 
    
         
            +
            - lib/lutaml/model/error/collection_true_missing_error.rb
         
     | 
| 
       62 
63 
     | 
    
         
             
            - lib/lutaml/model/error/incorrect_mapping_argument_error.rb
         
     | 
| 
       63 
64 
     | 
    
         
             
            - lib/lutaml/model/error/invalid_value_error.rb
         
     | 
| 
      
 65 
     | 
    
         
            +
            - lib/lutaml/model/error/multiple_mappings_error.rb
         
     | 
| 
       64 
66 
     | 
    
         
             
            - lib/lutaml/model/error/pattern_not_matched_error.rb
         
     | 
| 
       65 
67 
     | 
    
         
             
            - lib/lutaml/model/error/type_error.rb
         
     | 
| 
       66 
68 
     | 
    
         
             
            - lib/lutaml/model/error/type_not_enabled_error.rb
         
     | 
| 
         @@ -74,6 +76,7 @@ files: 
     | 
|
| 
       74 
76 
     | 
    
         
             
            - lib/lutaml/model/json_adapter/standard_json_adapter.rb
         
     | 
| 
       75 
77 
     | 
    
         
             
            - lib/lutaml/model/key_value_mapping.rb
         
     | 
| 
       76 
78 
     | 
    
         
             
            - lib/lutaml/model/key_value_mapping_rule.rb
         
     | 
| 
      
 79 
     | 
    
         
            +
            - lib/lutaml/model/loggable.rb
         
     | 
| 
       77 
80 
     | 
    
         
             
            - lib/lutaml/model/mapping_hash.rb
         
     | 
| 
       78 
81 
     | 
    
         
             
            - lib/lutaml/model/mapping_rule.rb
         
     | 
| 
       79 
82 
     | 
    
         
             
            - lib/lutaml/model/schema.rb
         
     | 
| 
         @@ -153,6 +156,7 @@ files: 
     | 
|
| 
       153 
156 
     | 
    
         
             
            - spec/lutaml/model/namespace_spec.rb
         
     | 
| 
       154 
157 
     | 
    
         
             
            - spec/lutaml/model/ordered_content_spec.rb
         
     | 
| 
       155 
158 
     | 
    
         
             
            - spec/lutaml/model/render_nil_spec.rb
         
     | 
| 
      
 159 
     | 
    
         
            +
            - spec/lutaml/model/root_mappings_spec.rb
         
     | 
| 
       156 
160 
     | 
    
         
             
            - spec/lutaml/model/schema/json_schema_spec.rb
         
     | 
| 
       157 
161 
     | 
    
         
             
            - spec/lutaml/model/schema/relaxng_schema_spec.rb
         
     | 
| 
       158 
162 
     | 
    
         
             
            - spec/lutaml/model/schema/xsd_schema_spec.rb
         
     |