lutaml-model 0.8.9 → 0.8.10
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 +12 -32
- data/lib/lutaml/key_value/transform.rb +5 -5
- data/lib/lutaml/key_value/transformation/collection_serializer.rb +25 -11
- data/lib/lutaml/key_value/transformation/value_serializer.rb +7 -7
- data/lib/lutaml/key_value/transformation.rb +27 -17
- data/lib/lutaml/model/adapter_resolver.rb +4 -6
- data/lib/lutaml/model/attribute.rb +26 -23
- data/lib/lutaml/model/cached_type_resolver.rb +10 -9
- data/lib/lutaml/model/cli.rb +1 -1
- data/lib/lutaml/model/collection.rb +4 -4
- data/lib/lutaml/model/comparable_model.rb +11 -11
- data/lib/lutaml/model/config.rb +1 -1
- data/lib/lutaml/model/consolidation/dispatcher.rb +1 -1
- data/lib/lutaml/model/consolidation/pattern_chunker.rb +3 -3
- data/lib/lutaml/model/format_registry.rb +6 -4
- data/lib/lutaml/model/global_context.rb +2 -2
- data/lib/lutaml/model/global_register.rb +1 -1
- data/lib/lutaml/model/instrumentation.rb +1 -1
- data/lib/lutaml/model/mapping/mapping_rule.rb +3 -3
- data/lib/lutaml/model/mapping/model_mapping.rb +1 -1
- data/lib/lutaml/model/mapping/model_mapping_rule.rb +1 -1
- data/lib/lutaml/model/register.rb +3 -3
- data/lib/lutaml/model/render_policy.rb +11 -17
- data/lib/lutaml/model/runtime_compatibility.rb +0 -1
- data/lib/lutaml/model/schema/xml_compiler/group.rb +1 -1
- data/lib/lutaml/model/schema/xml_compiler/registry_generator.rb +1 -1
- data/lib/lutaml/model/schema/xml_compiler/sequence.rb +0 -2
- data/lib/lutaml/model/schema/xml_compiler.rb +14 -14
- data/lib/lutaml/model/serialize/attribute_definition.rb +1 -1
- data/lib/lutaml/model/serialize/deserialization_context.rb +50 -0
- data/lib/lutaml/model/serialize/format_conversion.rb +2 -2
- data/lib/lutaml/model/serialize/initialization.rb +44 -7
- data/lib/lutaml/model/serialize/model_import.rb +1 -1
- data/lib/lutaml/model/serialize.rb +8 -1
- data/lib/lutaml/model/services/rule_value_extractor.rb +2 -1
- data/lib/lutaml/model/store.rb +27 -21
- data/lib/lutaml/model/transformation_registry.rb +1 -1
- data/lib/lutaml/model/type_context.rb +7 -1
- data/lib/lutaml/model/type_resolver.rb +1 -6
- data/lib/lutaml/model/utils.rb +19 -6
- data/lib/lutaml/model/validation_framework.rb +1 -1
- data/lib/lutaml/model/value_transformer.rb +2 -2
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/xml/adapter/adapter_helpers.rb +1 -1
- data/lib/lutaml/xml/adapter/base_adapter.rb +10 -14
- data/lib/lutaml/xml/adapter/namespace_uri_collector.rb +3 -3
- data/lib/lutaml/xml/adapter/plan_based_builder.rb +14 -14
- data/lib/lutaml/xml/adapter/xml_serializer.rb +3 -3
- data/lib/lutaml/xml/configurable.rb +2 -1
- data/lib/lutaml/xml/data_model.rb +2 -2
- data/lib/lutaml/xml/decisions/decision_context.rb +3 -3
- data/lib/lutaml/xml/decisions/rules/element_form_default_unqualified_rule.rb +1 -1
- data/lib/lutaml/xml/decisions/rules/element_form_option_rule.rb +1 -1
- data/lib/lutaml/xml/decisions/rules/used_prefix_rule.rb +1 -1
- data/lib/lutaml/xml/declaration_plan.rb +2 -2
- data/lib/lutaml/xml/declaration_planner.rb +12 -13
- data/lib/lutaml/xml/document.rb +13 -13
- data/lib/lutaml/xml/format_chooser.rb +3 -3
- data/lib/lutaml/xml/hoisting_algorithm.rb +1 -1
- data/lib/lutaml/xml/mapping.rb +2 -2
- data/lib/lutaml/xml/mapping_rule.rb +16 -3
- data/lib/lutaml/xml/model_transform.rb +17 -19
- data/lib/lutaml/xml/namespace_collector.rb +10 -10
- data/lib/lutaml/xml/namespace_declaration.rb +2 -2
- data/lib/lutaml/xml/namespace_declaration_data.rb +5 -8
- data/lib/lutaml/xml/namespace_scope_config.rb +3 -2
- data/lib/lutaml/xml/namespace_type_resolver.rb +4 -4
- data/lib/lutaml/xml/nokogiri/element.rb +2 -2
- data/lib/lutaml/xml/polymorphic_value_handler.rb +1 -1
- data/lib/lutaml/xml/schema/xsd/base.rb +7 -7
- data/lib/lutaml/xml/schema/xsd/choice.rb +2 -2
- data/lib/lutaml/xml/schema/xsd/complex_type.rb +5 -5
- data/lib/lutaml/xml/schema/xsd/errors/message_builder.rb +3 -3
- data/lib/lutaml/xml/schema/xsd/group.rb +2 -2
- data/lib/lutaml/xml/schema/xsd/sequence.rb +2 -2
- data/lib/lutaml/xml/schema/xsd_schema.rb +5 -5
- data/lib/lutaml/xml/serialization/format_conversion.rb +4 -3
- data/lib/lutaml/xml/transformation/element_builder.rb +4 -2
- data/lib/lutaml/xml/transformation/rule_applier.rb +2 -2
- data/lib/lutaml/xml/transformation/value_serializer.rb +4 -6
- data/lib/lutaml/xml/transformation.rb +4 -4
- data/lib/lutaml/xml/type/configurable.rb +0 -4
- data/lib/lutaml/xml/xml_element.rb +21 -13
- data/lutaml-model.gemspec +1 -1
- data/spec/lutaml/model/cached_type_resolver_spec.rb +3 -3
- data/spec/lutaml/model/optimization_spec.rb +228 -0
- data/spec/lutaml/model/store_spec.rb +41 -0
- data/spec/lutaml/xml/data_model_spec.rb +10 -28
- metadata +6 -4
|
@@ -6,15 +6,10 @@ RSpec.describe Lutaml::Xml::DataModel do
|
|
|
6
6
|
describe Lutaml::Xml::DataModel::XmlElement do
|
|
7
7
|
let(:element_name) { "test-element" }
|
|
8
8
|
let(:namespace_class) do
|
|
9
|
-
Class.new
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def self.uri
|
|
15
|
-
"http://example.com/test"
|
|
16
|
-
end
|
|
17
|
-
end
|
|
9
|
+
ns = Class.new(Lutaml::Xml::Namespace)
|
|
10
|
+
ns.prefix_default "test"
|
|
11
|
+
ns.uri "http://example.com/test"
|
|
12
|
+
ns
|
|
18
13
|
end
|
|
19
14
|
|
|
20
15
|
describe "#initialize" do
|
|
@@ -146,11 +141,7 @@ RSpec.describe Lutaml::Xml::DataModel do
|
|
|
146
141
|
end
|
|
147
142
|
|
|
148
143
|
it "returns unprefixed when namespace has no prefix" do
|
|
149
|
-
ns_no_prefix = Class.new
|
|
150
|
-
def self.prefix_default
|
|
151
|
-
nil
|
|
152
|
-
end
|
|
153
|
-
end
|
|
144
|
+
ns_no_prefix = Class.new(Lutaml::Xml::Namespace)
|
|
154
145
|
element = described_class.new("element", ns_no_prefix)
|
|
155
146
|
|
|
156
147
|
expect(element.qualified_name).to eq("element")
|
|
@@ -208,15 +199,10 @@ RSpec.describe Lutaml::Xml::DataModel do
|
|
|
208
199
|
let(:attr_name) { "test-attr" }
|
|
209
200
|
let(:attr_value) { "test-value" }
|
|
210
201
|
let(:namespace_class) do
|
|
211
|
-
Class.new
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
def self.uri
|
|
217
|
-
"http://example.com/test"
|
|
218
|
-
end
|
|
219
|
-
end
|
|
202
|
+
ns = Class.new(Lutaml::Xml::Namespace)
|
|
203
|
+
ns.prefix_default "test"
|
|
204
|
+
ns.uri "http://example.com/test"
|
|
205
|
+
ns
|
|
220
206
|
end
|
|
221
207
|
|
|
222
208
|
describe "#initialize" do
|
|
@@ -257,11 +243,7 @@ RSpec.describe Lutaml::Xml::DataModel do
|
|
|
257
243
|
end
|
|
258
244
|
|
|
259
245
|
it "returns unprefixed when namespace has no prefix" do
|
|
260
|
-
ns_no_prefix = Class.new
|
|
261
|
-
def self.prefix_default
|
|
262
|
-
nil
|
|
263
|
-
end
|
|
264
|
-
end
|
|
246
|
+
ns_no_prefix = Class.new(Lutaml::Xml::Namespace)
|
|
265
247
|
attribute = described_class.new(attr_name, attr_value, ns_no_prefix)
|
|
266
248
|
|
|
267
249
|
expect(attribute.qualified_name).to eq(attr_name)
|
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.8.
|
|
4
|
+
version: 0.8.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -92,14 +92,14 @@ dependencies:
|
|
|
92
92
|
requirements:
|
|
93
93
|
- - ">="
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.1.
|
|
95
|
+
version: 0.1.20
|
|
96
96
|
type: :runtime
|
|
97
97
|
prerelease: false
|
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
|
100
100
|
- - ">="
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: 0.1.
|
|
102
|
+
version: 0.1.20
|
|
103
103
|
- !ruby/object:Gem::Dependency
|
|
104
104
|
name: ostruct
|
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -532,6 +532,7 @@ files:
|
|
|
532
532
|
- lib/lutaml/model/serialize.rb
|
|
533
533
|
- lib/lutaml/model/serialize/attribute_definition.rb
|
|
534
534
|
- lib/lutaml/model/serialize/builder.rb
|
|
535
|
+
- lib/lutaml/model/serialize/deserialization_context.rb
|
|
535
536
|
- lib/lutaml/model/serialize/enum_handling.rb
|
|
536
537
|
- lib/lutaml/model/serialize/format_conversion.rb
|
|
537
538
|
- lib/lutaml/model/serialize/initialization.rb
|
|
@@ -1614,6 +1615,7 @@ files:
|
|
|
1614
1615
|
- spec/lutaml/model/multiple_mapping_spec.rb
|
|
1615
1616
|
- spec/lutaml/model/namespace_versioning_spec.rb
|
|
1616
1617
|
- spec/lutaml/model/one_entry_cache_spec.rb
|
|
1618
|
+
- spec/lutaml/model/optimization_spec.rb
|
|
1617
1619
|
- spec/lutaml/model/ordered_content_spec.rb
|
|
1618
1620
|
- spec/lutaml/model/polymorphic_spec.rb
|
|
1619
1621
|
- spec/lutaml/model/processing_instruction_spec.rb
|