lutaml-model 0.6.7 → 0.7.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/.github/workflows/dependent-repos-todo.json +7 -0
- data/.github/workflows/dependent-repos.json +17 -9
- data/.rubocop_todo.yml +18 -33
- data/README.adoc +4380 -2557
- data/lib/lutaml/model/attribute.rb +94 -15
- data/lib/lutaml/model/choice.rb +7 -0
- data/lib/lutaml/model/comparable_model.rb +48 -9
- data/lib/lutaml/model/error/collection_count_out_of_range_error.rb +1 -1
- data/lib/lutaml/model/error/polymorphic_error.rb +9 -0
- data/lib/lutaml/model/error.rb +1 -0
- data/lib/lutaml/model/mapping/json_mapping.rb +17 -0
- data/lib/lutaml/model/{key_value_mapping.rb → mapping/key_value_mapping.rb} +58 -14
- data/lib/lutaml/model/{key_value_mapping_rule.rb → mapping/key_value_mapping_rule.rb} +18 -2
- data/lib/lutaml/model/mapping/mapping_rule.rb +299 -0
- data/lib/lutaml/model/mapping/toml_mapping.rb +25 -0
- data/lib/lutaml/model/{xml_mapping.rb → mapping/xml_mapping.rb} +97 -15
- data/lib/lutaml/model/{xml_mapping_rule.rb → mapping/xml_mapping_rule.rb} +20 -3
- data/lib/lutaml/model/mapping/yaml_mapping.rb +17 -0
- data/lib/lutaml/model/mapping.rb +14 -0
- data/lib/lutaml/model/schema/xml_compiler.rb +15 -15
- data/lib/lutaml/model/sequence.rb +2 -2
- data/lib/lutaml/model/serialize.rb +247 -97
- data/lib/lutaml/model/type/date.rb +1 -1
- data/lib/lutaml/model/type/date_time.rb +2 -2
- data/lib/lutaml/model/type/hash.rb +1 -1
- data/lib/lutaml/model/type/time.rb +2 -2
- data/lib/lutaml/model/type/time_without_date.rb +2 -2
- data/lib/lutaml/model/uninitialized_class.rb +64 -0
- data/lib/lutaml/model/utils.rb +14 -0
- data/lib/lutaml/model/validation.rb +1 -0
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +1 -1
- data/lib/lutaml/model/xml_adapter/oga_adapter.rb +1 -1
- data/lib/lutaml/model/xml_adapter/ox_adapter.rb +1 -1
- data/lib/lutaml/model/xml_adapter/xml_document.rb +38 -17
- data/lib/lutaml/model/xml_adapter/xml_element.rb +17 -7
- data/lib/lutaml/model.rb +1 -0
- data/spec/benchmarks/xml_parsing_benchmark_spec.rb +3 -3
- data/spec/fixtures/person.rb +5 -5
- data/spec/lutaml/model/attribute_spec.rb +37 -1
- data/spec/lutaml/model/cdata_spec.rb +2 -2
- data/spec/lutaml/model/collection_spec.rb +50 -2
- data/spec/lutaml/model/comparable_model_spec.rb +92 -27
- data/spec/lutaml/model/defaults_spec.rb +1 -1
- data/spec/lutaml/model/enum_spec.rb +1 -1
- data/spec/lutaml/model/group_spec.rb +316 -14
- data/spec/lutaml/model/key_value_mapping_spec.rb +41 -3
- data/spec/lutaml/model/polymorphic_spec.rb +348 -0
- data/spec/lutaml/model/render_empty_spec.rb +194 -0
- data/spec/lutaml/model/render_nil_spec.rb +206 -22
- data/spec/lutaml/model/simple_model_spec.rb +9 -9
- data/spec/lutaml/model/value_map_spec.rb +240 -0
- data/spec/lutaml/model/xml/namespace/nested_with_explicit_namespace_spec.rb +85 -0
- data/spec/lutaml/model/xml/xml_element_spec.rb +93 -0
- data/spec/lutaml/model/xml_mapping_rule_spec.rb +102 -2
- data/spec/lutaml/model/xml_mapping_spec.rb +45 -3
- data/spec/sample_model_spec.rb +3 -3
- metadata +20 -8
- data/lib/lutaml/model/mapping_rule.rb +0 -109
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: cecafb59be2b3688099d64dac6ba5f3908062b4fc4ec378c122a4e2b614e8b98
         | 
| 4 | 
            +
              data.tar.gz: 71695f79ad3b38145e775f5d64c2b9fd39f359d0503aecea53789f020f815e64
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 38cc6c40d4956f5056932d2fd72becb8ea488948639b197cff73a9b927762365a48e81822cd8408970725d7cadb998a2c7f5fca1c70ac61ec72948ba08aee499
         | 
| 7 | 
            +
              data.tar.gz: '08b511a0d9543c3553e8d9a3b7cc669484ba03d7dac37dcd096ba2a9e44de1853a4a15744e710a8b3bbe883461716b8556ede6330a371cb9c82bf3a811b59fab'
         | 
| @@ -1,17 +1,25 @@ | |
| 1 1 | 
             
            {
         | 
| 2 2 | 
             
              "repo": [
         | 
| 3 | 
            +
                "glossarist/glossarist-ruby",
         | 
| 4 | 
            +
                "glossarist/iev",
         | 
| 5 | 
            +
                "glossarist/termium",
         | 
| 3 6 | 
             
                "lutaml/genericode",
         | 
| 7 | 
            +
                "lutaml/lutaml-xsd",
         | 
| 8 | 
            +
                "lutaml/metaschema",
         | 
| 4 9 | 
             
                "lutaml/ogc-gml",
         | 
| 10 | 
            +
                "lutaml/xmi",
         | 
| 11 | 
            +
                "metanorma/atmospheric",
         | 
| 12 | 
            +
                "metanorma/metanorma-cli",
         | 
| 5 13 | 
             
                "metanorma/modspec-ruby",
         | 
| 6 | 
            -
                "metanorma/rfcxml",
         | 
| 7 14 | 
             
                "metanorma/niso-jats",
         | 
| 15 | 
            +
                "metanorma/revix",
         | 
| 16 | 
            +
                "metanorma/rfcxml",
         | 
| 8 17 | 
             
                "metanorma/sts-ruby",
         | 
| 9 | 
            -
                " | 
| 10 | 
            -
                " | 
| 11 | 
            -
                " | 
| 12 | 
            -
                " | 
| 13 | 
            -
                " | 
| 14 | 
            -
                " | 
| 15 | 
            -
                "lutaml/lutaml-xsd"
         | 
| 18 | 
            +
                "plurimath/mml",
         | 
| 19 | 
            +
                "plurimath/plurimath",
         | 
| 20 | 
            +
                "relaton/ieee-idams",
         | 
| 21 | 
            +
                "relaton/loc_mods",
         | 
| 22 | 
            +
                "relaton/w3c_api",
         | 
| 23 | 
            +
                "unitsml/unitsml-ruby"
         | 
| 16 24 | 
             
              ]
         | 
| 17 | 
            -
            }
         | 
| 25 | 
            +
            }
         | 
    
        data/.rubocop_todo.yml
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            # This configuration was generated by
         | 
| 2 2 | 
             
            # `rubocop --auto-gen-config`
         | 
| 3 | 
            -
            # on 2025- | 
| 3 | 
            +
            # on 2025-03-19 06:02:51 UTC using RuboCop version 1.73.2.
         | 
| 4 4 | 
             
            # The point is for the user to remove these configuration records
         | 
| 5 5 | 
             
            # one by one as the offenses are removed from the code base.
         | 
| 6 6 | 
             
            # Note that changes in the inspected code, or installation of new
         | 
| @@ -27,7 +27,7 @@ Layout/IndentationWidth: | |
| 27 27 | 
             
              Exclude:
         | 
| 28 28 | 
             
                - 'lib/lutaml/model/schema/xml_compiler.rb'
         | 
| 29 29 |  | 
| 30 | 
            -
            # Offense count:  | 
| 30 | 
            +
            # Offense count: 484
         | 
| 31 31 | 
             
            # This cop supports safe autocorrection (--autocorrect).
         | 
| 32 32 | 
             
            # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
         | 
| 33 33 | 
             
            # URISchemes: http, https
         | 
| @@ -42,14 +42,16 @@ Lint/ConstantDefinitionInBlock: | |
| 42 42 | 
             
                - 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
         | 
| 43 43 | 
             
                - 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
         | 
| 44 44 |  | 
| 45 | 
            -
            # Offense count:  | 
| 45 | 
            +
            # Offense count: 58
         | 
| 46 46 | 
             
            # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
         | 
| 47 47 | 
             
            Metrics/AbcSize:
         | 
| 48 48 | 
             
              Exclude:
         | 
| 49 49 | 
             
                - 'lib/lutaml/model/attribute.rb'
         | 
| 50 50 | 
             
                - 'lib/lutaml/model/comparable_model.rb'
         | 
| 51 | 
            -
                - 'lib/lutaml/model/ | 
| 52 | 
            -
                - 'lib/lutaml/model/mapping_rule.rb'
         | 
| 51 | 
            +
                - 'lib/lutaml/model/mapping/key_value_mapping_rule.rb'
         | 
| 52 | 
            +
                - 'lib/lutaml/model/mapping/mapping_rule.rb'
         | 
| 53 | 
            +
                - 'lib/lutaml/model/mapping/xml_mapping.rb'
         | 
| 54 | 
            +
                - 'lib/lutaml/model/mapping/xml_mapping_rule.rb'
         | 
| 53 55 | 
             
                - 'lib/lutaml/model/schema/relaxng_schema.rb'
         | 
| 54 56 | 
             
                - 'lib/lutaml/model/schema/xml_compiler.rb'
         | 
| 55 57 | 
             
                - 'lib/lutaml/model/schema/xsd_schema.rb'
         | 
| @@ -59,14 +61,12 @@ Metrics/AbcSize: | |
| 59 61 | 
             
                - 'lib/lutaml/model/xml_adapter/oga_adapter.rb'
         | 
| 60 62 | 
             
                - 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
         | 
| 61 63 | 
             
                - 'lib/lutaml/model/xml_adapter/xml_document.rb'
         | 
| 62 | 
            -
                - 'lib/lutaml/model/xml_mapping.rb'
         | 
| 63 | 
            -
                - 'lib/lutaml/model/xml_mapping_rule.rb'
         | 
| 64 64 |  | 
| 65 65 | 
             
            # Offense count: 12
         | 
| 66 66 | 
             
            # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
         | 
| 67 67 | 
             
            # AllowedMethods: refine
         | 
| 68 68 | 
             
            Metrics/BlockLength:
         | 
| 69 | 
            -
              Max:  | 
| 69 | 
            +
              Max: 47
         | 
| 70 70 |  | 
| 71 71 | 
             
            # Offense count: 47
         | 
| 72 72 | 
             
            # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
         | 
| @@ -74,8 +74,6 @@ Metrics/CyclomaticComplexity: | |
| 74 74 | 
             
              Exclude:
         | 
| 75 75 | 
             
                - 'lib/lutaml/model/attribute.rb'
         | 
| 76 76 | 
             
                - 'lib/lutaml/model/comparable_model.rb'
         | 
| 77 | 
            -
                - 'lib/lutaml/model/key_value_mapping.rb'
         | 
| 78 | 
            -
                - 'lib/lutaml/model/mapping_rule.rb'
         | 
| 79 77 | 
             
                - 'lib/lutaml/model/schema/xml_compiler.rb'
         | 
| 80 78 | 
             
                - 'lib/lutaml/model/serialize.rb'
         | 
| 81 79 | 
             
                - 'lib/lutaml/model/type/integer.rb'
         | 
| @@ -85,24 +83,22 @@ Metrics/CyclomaticComplexity: | |
| 85 83 | 
             
                - 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
         | 
| 86 84 | 
             
                - 'lib/lutaml/model/xml_adapter/xml_document.rb'
         | 
| 87 85 |  | 
| 88 | 
            -
            # Offense count:  | 
| 86 | 
            +
            # Offense count: 91
         | 
| 89 87 | 
             
            # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
         | 
| 90 88 | 
             
            Metrics/MethodLength:
         | 
| 91 | 
            -
              Max:  | 
| 89 | 
            +
              Max: 44
         | 
| 92 90 |  | 
| 93 | 
            -
            # Offense count:  | 
| 91 | 
            +
            # Offense count: 9
         | 
| 94 92 | 
             
            # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
         | 
| 95 93 | 
             
            Metrics/ParameterLists:
         | 
| 96 | 
            -
              Max:  | 
| 94 | 
            +
              Max: 22
         | 
| 97 95 |  | 
| 98 | 
            -
            # Offense count:  | 
| 96 | 
            +
            # Offense count: 38
         | 
| 99 97 | 
             
            # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
         | 
| 100 98 | 
             
            Metrics/PerceivedComplexity:
         | 
| 101 99 | 
             
              Exclude:
         | 
| 102 100 | 
             
                - 'lib/lutaml/model/attribute.rb'
         | 
| 103 101 | 
             
                - 'lib/lutaml/model/comparable_model.rb'
         | 
| 104 | 
            -
                - 'lib/lutaml/model/key_value_mapping.rb'
         | 
| 105 | 
            -
                - 'lib/lutaml/model/mapping_rule.rb'
         | 
| 106 102 | 
             
                - 'lib/lutaml/model/schema/xml_compiler.rb'
         | 
| 107 103 | 
             
                - 'lib/lutaml/model/serialize.rb'
         | 
| 108 104 | 
             
                - 'lib/lutaml/model/type/integer.rb'
         | 
| @@ -130,7 +126,7 @@ RSpec/DescribeClass: | |
| 130 126 | 
             
                - 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
         | 
| 131 127 | 
             
                - 'spec/lutaml/model/transformation_spec.rb'
         | 
| 132 128 |  | 
| 133 | 
            -
            # Offense count:  | 
| 129 | 
            +
            # Offense count: 2
         | 
| 134 130 | 
             
            # This cop supports unsafe autocorrection (--autocorrect-all).
         | 
| 135 131 | 
             
            # Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
         | 
| 136 132 | 
             
            # SupportedStyles: described_class, explicit
         | 
| @@ -138,7 +134,7 @@ RSpec/DescribedClass: | |
| 138 134 | 
             
              Exclude:
         | 
| 139 135 | 
             
                - 'spec/lutaml/model/xml_mapping_spec.rb'
         | 
| 140 136 |  | 
| 141 | 
            -
            # Offense count:  | 
| 137 | 
            +
            # Offense count: 163
         | 
| 142 138 | 
             
            # Configuration parameters: CountAsOne.
         | 
| 143 139 | 
             
            RSpec/ExampleLength:
         | 
| 144 140 | 
             
              Max: 54
         | 
| @@ -149,16 +145,16 @@ RSpec/LeakyConstantDeclaration: | |
| 149 145 | 
             
                - 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
         | 
| 150 146 | 
             
                - 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
         | 
| 151 147 |  | 
| 152 | 
            -
            # Offense count:  | 
| 148 | 
            +
            # Offense count: 210
         | 
| 153 149 | 
             
            RSpec/MultipleExpectations:
         | 
| 154 150 | 
             
              Max: 14
         | 
| 155 151 |  | 
| 156 | 
            -
            # Offense count:  | 
| 152 | 
            +
            # Offense count: 30
         | 
| 157 153 | 
             
            # Configuration parameters: AllowSubject.
         | 
| 158 154 | 
             
            RSpec/MultipleMemoizedHelpers:
         | 
| 159 155 | 
             
              Max: 9
         | 
| 160 156 |  | 
| 161 | 
            -
            # Offense count:  | 
| 157 | 
            +
            # Offense count: 118
         | 
| 162 158 | 
             
            # Configuration parameters: AllowedGroups.
         | 
| 163 159 | 
             
            RSpec/NestedGroups:
         | 
| 164 160 | 
             
              Max: 4
         | 
| @@ -180,11 +176,6 @@ RSpec/SpecFilePathFormat: | |
| 180 176 | 
             
                - 'spec/lutaml/model/defaults_spec.rb'
         | 
| 181 177 | 
             
                - 'spec/lutaml/model/type/decimal_spec.rb'
         | 
| 182 178 |  | 
| 183 | 
            -
            # Offense count: 1
         | 
| 184 | 
            -
            Security/CompoundHash:
         | 
| 185 | 
            -
              Exclude:
         | 
| 186 | 
            -
                - 'lib/lutaml/model/comparable_model.rb'
         | 
| 187 | 
            -
             | 
| 188 179 | 
             
            # Offense count: 1
         | 
| 189 180 | 
             
            # This cop supports unsafe autocorrection (--autocorrect-all).
         | 
| 190 181 | 
             
            # Configuration parameters: AllowedReceivers.
         | 
| @@ -211,9 +202,3 @@ Style/RedundantStringEscape: | |
| 211 202 | 
             
              Exclude:
         | 
| 212 203 | 
             
                - 'lib/lutaml/model/schema/templates/simple_type.rb'
         | 
| 213 204 | 
             
                - 'lib/lutaml/model/schema/xml_compiler.rb'
         | 
| 214 | 
            -
             | 
| 215 | 
            -
            # Offense count: 1
         | 
| 216 | 
            -
            # Configuration parameters: Max.
         | 
| 217 | 
            -
            Style/SafeNavigationChainLength:
         | 
| 218 | 
            -
              Exclude:
         | 
| 219 | 
            -
                - 'lib/lutaml/model/serialize.rb'
         |