lutaml-model 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +58 -21
- data/Gemfile +1 -0
- data/README.adoc +1112 -264
- data/lib/lutaml/model/attribute.rb +33 -10
- data/lib/lutaml/model/choice.rb +56 -0
- data/lib/lutaml/model/config.rb +1 -0
- data/lib/lutaml/model/error/choice_lower_bound_error.rb +9 -0
- data/lib/lutaml/model/error/choice_upper_bound_error.rb +9 -0
- data/lib/lutaml/model/error/import_model_with_root_error.rb +9 -0
- data/lib/lutaml/model/error/incorrect_sequence_error.rb +9 -0
- data/lib/lutaml/model/error/invalid_choice_range_error.rb +20 -0
- data/lib/lutaml/model/error/no_root_mapping_error.rb +9 -0
- data/lib/lutaml/model/error/no_root_namespace_error.rb +9 -0
- data/lib/lutaml/model/error/unknown_sequence_mapping_error.rb +9 -0
- data/lib/lutaml/model/error.rb +8 -0
- data/lib/lutaml/model/json_adapter/standard_json_adapter.rb +6 -1
- data/lib/lutaml/model/key_value_mapping.rb +3 -1
- data/lib/lutaml/model/key_value_mapping_rule.rb +4 -2
- data/lib/lutaml/model/liquefiable.rb +59 -0
- data/lib/lutaml/model/mapping_hash.rb +1 -1
- data/lib/lutaml/model/mapping_rule.rb +15 -2
- data/lib/lutaml/model/schema/xml_compiler.rb +68 -26
- data/lib/lutaml/model/schema_location.rb +7 -0
- data/lib/lutaml/model/sequence.rb +71 -0
- data/lib/lutaml/model/serialize.rb +125 -35
- data/lib/lutaml/model/type/decimal.rb +0 -4
- data/lib/lutaml/model/type/time.rb +3 -3
- data/lib/lutaml/model/utils.rb +19 -15
- data/lib/lutaml/model/validation.rb +12 -1
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model/xml_adapter/builder/oga.rb +10 -7
- data/lib/lutaml/model/xml_adapter/builder/ox.rb +20 -13
- data/lib/lutaml/model/xml_adapter/element.rb +32 -0
- data/lib/lutaml/model/xml_adapter/nokogiri_adapter.rb +8 -8
- data/lib/lutaml/model/xml_adapter/oga/element.rb +14 -13
- data/lib/lutaml/model/xml_adapter/oga_adapter.rb +86 -19
- data/lib/lutaml/model/xml_adapter/ox_adapter.rb +19 -15
- data/lib/lutaml/model/xml_adapter/xml_document.rb +74 -13
- data/lib/lutaml/model/xml_adapter/xml_element.rb +57 -3
- data/lib/lutaml/model/xml_mapping.rb +49 -7
- data/lib/lutaml/model/xml_mapping_rule.rb +8 -3
- data/lib/lutaml/model.rb +1 -0
- data/lutaml-model.gemspec +5 -0
- data/spec/benchmarks/xml_parsing_benchmark_spec.rb +75 -0
- data/spec/ceramic_spec.rb +39 -0
- data/spec/fixtures/ceramic.rb +23 -0
- data/spec/fixtures/xml/address_example_260.xsd +9 -0
- data/spec/fixtures/xml/user.xsd +10 -0
- data/spec/lutaml/model/cdata_spec.rb +4 -5
- data/spec/lutaml/model/choice_spec.rb +168 -0
- data/spec/lutaml/model/collection_spec.rb +1 -1
- data/spec/lutaml/model/custom_model_spec.rb +6 -7
- data/spec/lutaml/model/custom_serialization_spec.rb +74 -2
- data/spec/lutaml/model/defaults_spec.rb +3 -1
- data/spec/lutaml/model/delegation_spec.rb +7 -5
- data/spec/lutaml/model/enum_spec.rb +35 -0
- data/spec/lutaml/model/group_spec.rb +160 -0
- data/spec/lutaml/model/inheritance_spec.rb +25 -0
- data/spec/lutaml/model/liquefiable_spec.rb +121 -0
- data/spec/lutaml/model/mixed_content_spec.rb +80 -41
- data/spec/lutaml/model/multiple_mapping_spec.rb +22 -10
- data/spec/lutaml/model/schema/xml_compiler_spec.rb +218 -25
- data/spec/lutaml/model/sequence_spec.rb +216 -0
- data/spec/lutaml/model/transformation_spec.rb +230 -0
- data/spec/lutaml/model/type_spec.rb +138 -31
- data/spec/lutaml/model/utils_spec.rb +32 -0
- data/spec/lutaml/model/xml_adapter/oga_adapter_spec.rb +11 -7
- data/spec/lutaml/model/xml_mapping_rule_spec.rb +51 -0
- data/spec/lutaml/model/xml_mapping_spec.rb +143 -112
- metadata +67 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9883cb9431e9cd0c40c6e30891e1fb84861f1b9e9e7eb31a1cb5c6ec0d6121dc
|
4
|
+
data.tar.gz: 2d00bb121ca7486d151f4daaacb86f98824ef5950460dc4caecffe4280c93607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df269be2c13bb4586e13d99dc79b47dbe1b445d49b8f23adf9c7ef502dae58deb77dd714431d29991c56e9aa9ac422a03910648e6f9a81414c7f375541fa6bf4
|
7
|
+
data.tar.gz: ed384722ad8f1fdb81671c8318ae0190c7372780a910ffece79e50658103344bd9f293afce048afa728cc91e47d952f6812bdbf2bce7a18d652d6704f9ef69cd
|
data/.rubocop_todo.yml
CHANGED
@@ -1,37 +1,61 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2025-
|
3
|
+
# on 2025-02-08 01:06:17 UTC using RuboCop version 1.71.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
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 2
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
Layout/ElseAlignment:
|
12
|
+
Exclude:
|
13
|
+
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
14
|
+
|
15
|
+
# Offense count: 2
|
16
|
+
# This cop supports safe autocorrection (--autocorrect).
|
17
|
+
# Configuration parameters: EnforcedStyleAlignWith, Severity.
|
18
|
+
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
19
|
+
Layout/EndAlignment:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
22
|
+
|
23
|
+
# Offense count: 2
|
24
|
+
# This cop supports safe autocorrection (--autocorrect).
|
25
|
+
# Configuration parameters: Width, AllowedPatterns.
|
26
|
+
Layout/IndentationWidth:
|
27
|
+
Exclude:
|
28
|
+
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
29
|
+
|
30
|
+
# Offense count: 596
|
10
31
|
# This cop supports safe autocorrection (--autocorrect).
|
11
32
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
12
33
|
# URISchemes: http, https
|
13
34
|
Layout/LineLength:
|
14
35
|
Enabled: false
|
15
36
|
|
16
|
-
# Offense count:
|
37
|
+
# Offense count: 19
|
17
38
|
# Configuration parameters: AllowedMethods.
|
18
39
|
# AllowedMethods: enums
|
19
40
|
Lint/ConstantDefinitionInBlock:
|
20
41
|
Exclude:
|
42
|
+
- 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
|
21
43
|
- 'spec/lutaml/model/schema/json_schema_spec.rb'
|
22
44
|
- 'spec/lutaml/model/schema/relaxng_schema_spec.rb'
|
23
45
|
- 'spec/lutaml/model/schema/xsd_schema_spec.rb'
|
24
46
|
- 'spec/lutaml/model/schema/yaml_schema_spec.rb'
|
25
|
-
- 'spec/lutaml/model/
|
47
|
+
- 'spec/lutaml/model/transformation_spec.rb'
|
26
48
|
- 'spec/lutaml/model/validation_spec.rb'
|
27
49
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
28
50
|
|
29
|
-
# Offense count:
|
51
|
+
# Offense count: 4
|
30
52
|
Lint/DuplicateMethods:
|
31
53
|
Exclude:
|
32
54
|
- 'lib/lutaml/model/type/float.rb'
|
55
|
+
- 'lib/lutaml/model/xml_adapter/xml_document.rb'
|
56
|
+
- 'lib/lutaml/model/xml_adapter/xml_element.rb'
|
33
57
|
|
34
|
-
# Offense count:
|
58
|
+
# Offense count: 56
|
35
59
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
36
60
|
Metrics/AbcSize:
|
37
61
|
Exclude:
|
@@ -64,6 +88,7 @@ Metrics/CyclomaticComplexity:
|
|
64
88
|
- 'lib/lutaml/model/attribute.rb'
|
65
89
|
- 'lib/lutaml/model/comparable_model.rb'
|
66
90
|
- 'lib/lutaml/model/key_value_mapping.rb'
|
91
|
+
- 'lib/lutaml/model/mapping_rule.rb'
|
67
92
|
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
68
93
|
- 'lib/lutaml/model/serialize.rb'
|
69
94
|
- 'lib/lutaml/model/type/integer.rb'
|
@@ -73,28 +98,28 @@ Metrics/CyclomaticComplexity:
|
|
73
98
|
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
74
99
|
- 'lib/lutaml/model/xml_adapter/xml_document.rb'
|
75
100
|
|
76
|
-
# Offense count:
|
101
|
+
# Offense count: 87
|
77
102
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
78
103
|
Metrics/MethodLength:
|
79
|
-
Max:
|
104
|
+
Max: 46
|
80
105
|
|
81
|
-
# Offense count:
|
106
|
+
# Offense count: 8
|
82
107
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
83
108
|
Metrics/ParameterLists:
|
84
|
-
Max:
|
109
|
+
Max: 15
|
85
110
|
|
86
|
-
# Offense count:
|
111
|
+
# Offense count: 37
|
87
112
|
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
88
113
|
Metrics/PerceivedComplexity:
|
89
114
|
Exclude:
|
90
115
|
- 'lib/lutaml/model/attribute.rb'
|
91
116
|
- 'lib/lutaml/model/comparable_model.rb'
|
92
117
|
- 'lib/lutaml/model/key_value_mapping.rb'
|
118
|
+
- 'lib/lutaml/model/mapping_rule.rb'
|
93
119
|
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
94
120
|
- 'lib/lutaml/model/serialize.rb'
|
95
121
|
- 'lib/lutaml/model/type/integer.rb'
|
96
122
|
- 'lib/lutaml/model/xml_adapter/builder/oga.rb'
|
97
|
-
- 'lib/lutaml/model/xml_adapter/builder/ox.rb'
|
98
123
|
- 'lib/lutaml/model/xml_adapter/nokogiri_adapter.rb'
|
99
124
|
- 'lib/lutaml/model/xml_adapter/oga_adapter.rb'
|
100
125
|
- 'lib/lutaml/model/xml_adapter/ox_adapter.rb'
|
@@ -117,6 +142,18 @@ RSpec/ContextWording:
|
|
117
142
|
- 'spec/lutaml/model/xml_mapping_spec.rb'
|
118
143
|
|
119
144
|
# Offense count: 2
|
145
|
+
# Configuration parameters: IgnoredMetadata.
|
146
|
+
RSpec/DescribeClass:
|
147
|
+
Exclude:
|
148
|
+
- '**/spec/features/**/*'
|
149
|
+
- '**/spec/requests/**/*'
|
150
|
+
- '**/spec/routing/**/*'
|
151
|
+
- '**/spec/system/**/*'
|
152
|
+
- '**/spec/views/**/*'
|
153
|
+
- 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
|
154
|
+
- 'spec/lutaml/model/transformation_spec.rb'
|
155
|
+
|
156
|
+
# Offense count: 1
|
120
157
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
121
158
|
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
122
159
|
# SupportedStyles: described_class, explicit
|
@@ -124,7 +161,7 @@ RSpec/DescribedClass:
|
|
124
161
|
Exclude:
|
125
162
|
- 'spec/lutaml/model/xml_mapping_spec.rb'
|
126
163
|
|
127
|
-
# Offense count:
|
164
|
+
# Offense count: 169
|
128
165
|
# Configuration parameters: CountAsOne.
|
129
166
|
RSpec/ExampleLength:
|
130
167
|
Max: 54
|
@@ -135,14 +172,15 @@ RSpec/IndexedLet:
|
|
135
172
|
Exclude:
|
136
173
|
- 'spec/address_spec.rb'
|
137
174
|
|
138
|
-
# Offense count:
|
175
|
+
# Offense count: 30
|
139
176
|
RSpec/LeakyConstantDeclaration:
|
140
177
|
Exclude:
|
178
|
+
- 'spec/benchmarks/xml_parsing_benchmark_spec.rb'
|
141
179
|
- 'spec/lutaml/model/schema/json_schema_spec.rb'
|
142
180
|
- 'spec/lutaml/model/schema/relaxng_schema_spec.rb'
|
143
181
|
- 'spec/lutaml/model/schema/xsd_schema_spec.rb'
|
144
182
|
- 'spec/lutaml/model/schema/yaml_schema_spec.rb'
|
145
|
-
- 'spec/lutaml/model/
|
183
|
+
- 'spec/lutaml/model/transformation_spec.rb'
|
146
184
|
- 'spec/lutaml/model/validation_spec.rb'
|
147
185
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
148
186
|
|
@@ -154,7 +192,7 @@ RSpec/MultipleDescribes:
|
|
154
192
|
- 'spec/lutaml/model/xml_adapter/xml_namespace_spec.rb'
|
155
193
|
- 'spec/lutaml/model/xml_adapter_spec.rb'
|
156
194
|
|
157
|
-
# Offense count:
|
195
|
+
# Offense count: 213
|
158
196
|
RSpec/MultipleExpectations:
|
159
197
|
Max: 14
|
160
198
|
|
@@ -163,7 +201,7 @@ RSpec/MultipleExpectations:
|
|
163
201
|
RSpec/MultipleMemoizedHelpers:
|
164
202
|
Max: 9
|
165
203
|
|
166
|
-
# Offense count:
|
204
|
+
# Offense count: 108
|
167
205
|
# Configuration parameters: AllowedGroups.
|
168
206
|
RSpec/NestedGroups:
|
169
207
|
Max: 4
|
@@ -246,8 +284,7 @@ Style/RedundantStringEscape:
|
|
246
284
|
- 'lib/lutaml/model/schema/xml_compiler.rb'
|
247
285
|
|
248
286
|
# Offense count: 1
|
249
|
-
#
|
250
|
-
|
251
|
-
Style/StringConcatenation:
|
287
|
+
# Configuration parameters: Max.
|
288
|
+
Style/SafeNavigationChainLength:
|
252
289
|
Exclude:
|
253
|
-
- '
|
290
|
+
- 'lib/lutaml/model/serialize.rb'
|