metaschema 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab01e7082a78f755a4aab0f12f4e6d0a57fda8c2c61c8820b44d084bd35e700e
4
- data.tar.gz: dde048935f730d08385f69cf32c3b56fd3e370786a716b3a643dfe68207a5c04
3
+ metadata.gz: 13c76286aac4a084b992310573e600bff798224156cbbfb1ec5a27b80fdf9ec8
4
+ data.tar.gz: 509b4a6032bec02787b65783e7ff253133b16ffebc1398bc9470f96a53403258
5
5
  SHA512:
6
- metadata.gz: 34ca02dd41aa6febd4d4dd6b167633040477381366fbd2dec9c503adcd83a7588dfcc9bdfc808ac7321940292c0c5cd35dbce22b7765a6999065eb8e2be14c3e
7
- data.tar.gz: d7c2da1a6bd83bbacc9d301c548a124972c1280dc1f4b3429412368dc4ed0ebfa5b871e7aa18f5abc719440bb5cbcd1282c64fcd26a0e8a924ad2eb783b8fe5b
6
+ metadata.gz: 6920a39f399434cbb2634f0395ae346af06bd80d95bebfba2cceba3ff08f4421cf483bc5b3078672d596b2df5b05c0d3a33afe595859e8df22052fc08b327c53
7
+ data.tar.gz: deaba8e56599fdab8902215b520eb7ba057b2fb82aab57126c5acea59a39b3916286dbd54d6563e4f7da7764b3a39a60c21b4f2f1d913b43d893980bf9acedb1
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-04-21 23:09:15 UTC using RuboCop version 1.86.1.
3
+ # on 2026-04-24 02:52:57 UTC using RuboCop version 1.86.1.
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
@@ -11,156 +11,15 @@ Gemspec/RequiredRubyVersion:
11
11
  Exclude:
12
12
  - 'metaschema.gemspec'
13
13
 
14
- # Offense count: 21
15
- # This cop supports safe autocorrection (--autocorrect).
16
- # Configuration parameters: EnforcedStyle, IndentationWidth.
17
- # SupportedStyles: with_first_argument, with_fixed_indentation
18
- Layout/ArgumentAlignment:
19
- Exclude:
20
- - 'lib/metaschema/constraint_validator.rb'
21
- - 'lib/metaschema/model_generator.rb'
22
- - 'lib/metaschema/ruby_source_emitter.rb'
23
- - 'spec/model_generator_spec.rb'
24
- - 'spec/ruby_source_emitter_spec.rb'
25
-
26
- # Offense count: 10
27
- # This cop supports safe autocorrection (--autocorrect).
28
- # Configuration parameters: EnforcedStyle, IndentationWidth.
29
- # SupportedStyles: with_first_element, with_fixed_indentation
30
- Layout/ArrayAlignment:
31
- Exclude:
32
- - 'lib/metaschema/markdown_doc_generator.rb'
33
- - 'lib/metaschema/model_generator.rb'
34
- - 'lib/metaschema/ruby_source_emitter.rb'
35
-
36
- # Offense count: 6
37
- # This cop supports safe autocorrection (--autocorrect).
38
- # Configuration parameters: IndentationWidth.
39
- Layout/AssignmentIndentation:
40
- Exclude:
41
- - 'lib/metaschema/json_schema_generator.rb'
42
- - 'lib/metaschema/model_generator.rb'
43
-
44
- # Offense count: 74
14
+ # Offense count: 1
45
15
  # This cop supports safe autocorrection (--autocorrect).
46
16
  # Configuration parameters: EnforcedStyleAlignWith.
47
17
  # SupportedStylesAlignWith: either, start_of_block, start_of_line
48
18
  Layout/BlockAlignment:
49
19
  Exclude:
50
- - 'lib/metaschema/constraint_validator.rb'
51
- - 'lib/metaschema/json_schema_generator.rb'
52
- - 'lib/metaschema/markdown_doc_generator.rb'
53
- - 'lib/metaschema/metapath_evaluator.rb'
54
- - 'lib/metaschema/model_generator.rb'
20
+ - 'lib/metaschema/model_generator/assembly_factory.rb'
55
21
 
56
- # Offense count: 71
57
- # This cop supports safe autocorrection (--autocorrect).
58
- Layout/BlockEndNewline:
59
- Exclude:
60
- - 'lib/metaschema/constraint_validator.rb'
61
- - 'lib/metaschema/json_schema_generator.rb'
62
- - 'lib/metaschema/markdown_doc_generator.rb'
63
- - 'lib/metaschema/metapath_evaluator.rb'
64
- - 'lib/metaschema/model_generator.rb'
65
-
66
- # Offense count: 7
67
- # This cop supports safe autocorrection (--autocorrect).
68
- # Configuration parameters: AllowForAlignment.
69
- Layout/CommentIndentation:
70
- Exclude:
71
- - 'lib/metaschema/model_generator.rb'
72
-
73
- # Offense count: 10
74
- # This cop supports safe autocorrection (--autocorrect).
75
- Layout/ElseAlignment:
76
- Exclude:
77
- - 'lib/metaschema/constraint_validator.rb'
78
- - 'lib/metaschema/json_schema_generator.rb'
79
- - 'lib/metaschema/model_generator.rb'
80
- - 'lib/metaschema/ruby_source_emitter.rb'
81
-
82
- # Offense count: 40
83
- # This cop supports safe autocorrection (--autocorrect).
84
- Layout/EmptyLineAfterGuardClause:
85
- Exclude:
86
- - 'lib/metaschema/constraint_validator.rb'
87
- - 'lib/metaschema/json_schema_generator.rb'
88
- - 'lib/metaschema/markdown_doc_generator.rb'
89
- - 'lib/metaschema/metapath_evaluator.rb'
90
- - 'lib/metaschema/model_generator.rb'
91
- - 'lib/metaschema/ruby_source_emitter.rb'
92
-
93
- # Offense count: 1
94
- # This cop supports safe autocorrection (--autocorrect).
95
- # Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
96
- Layout/EmptyLineBetweenDefs:
97
- Exclude:
98
- - 'lib/metaschema/constraint_validator.rb'
99
-
100
- # Offense count: 1
101
- # This cop supports safe autocorrection (--autocorrect).
102
- Layout/EmptyLines:
103
- Exclude:
104
- - 'lib/metaschema/constraint_validator.rb'
105
-
106
- # Offense count: 1
107
- # This cop supports safe autocorrection (--autocorrect).
108
- Layout/EmptyLinesAroundMethodBody:
109
- Exclude:
110
- - 'lib/metaschema/metapath_evaluator.rb'
111
-
112
- # Offense count: 11
113
- # This cop supports safe autocorrection (--autocorrect).
114
- # Configuration parameters: EnforcedStyleAlignWith.
115
- # SupportedStylesAlignWith: keyword, variable, start_of_line
116
- Layout/EndAlignment:
117
- Exclude:
118
- - 'lib/metaschema/constraint_validator.rb'
119
- - 'lib/metaschema/model_generator.rb'
120
- - 'lib/metaschema/ruby_source_emitter.rb'
121
-
122
- # Offense count: 1
123
- # This cop supports safe autocorrection (--autocorrect).
124
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
125
- Layout/ExtraSpacing:
126
- Exclude:
127
- - 'lib/metaschema/constraint_validator.rb'
128
-
129
- # Offense count: 33
130
- # This cop supports safe autocorrection (--autocorrect).
131
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
132
- # SupportedHashRocketStyles: key, separator, table
133
- # SupportedColonStyles: key, separator, table
134
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
135
- Layout/HashAlignment:
136
- Exclude:
137
- - 'lib/metaschema/json_schema_generator.rb'
138
- - 'lib/metaschema/model_generator.rb'
139
- - 'spec/model_generator_spec.rb'
140
-
141
- # Offense count: 33
142
- # This cop supports safe autocorrection (--autocorrect).
143
- # Configuration parameters: EnforcedStyle.
144
- # SupportedStyles: normal, indented_internal_methods
145
- Layout/IndentationConsistency:
146
- Exclude:
147
- - 'lib/metaschema/model_generator.rb'
148
- - 'lib/metaschema/ruby_source_emitter.rb'
149
-
150
- # Offense count: 174
151
- # This cop supports safe autocorrection (--autocorrect).
152
- # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
153
- # SupportedStylesAlignWith: start_of_line, relative_to_receiver
154
- Layout/IndentationWidth:
155
- Exclude:
156
- - 'lib/metaschema/constraint_validator.rb'
157
- - 'lib/metaschema/json_schema_generator.rb'
158
- - 'lib/metaschema/markdown_doc_generator.rb'
159
- - 'lib/metaschema/metapath_evaluator.rb'
160
- - 'lib/metaschema/model_generator.rb'
161
- - 'lib/metaschema/ruby_source_emitter.rb'
162
-
163
- # Offense count: 208
22
+ # Offense count: 92
164
23
  # This cop supports safe autocorrection (--autocorrect).
165
24
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
166
25
  # URISchemes: http, https
@@ -171,108 +30,35 @@ Layout/LineLength:
171
30
  - 'lib/metaschema/markdown_doc_generator.rb'
172
31
  - 'lib/metaschema/metapath_evaluator.rb'
173
32
  - 'lib/metaschema/model_generator.rb'
33
+ - 'lib/metaschema/model_generator/assembly_factory.rb'
34
+ - 'lib/metaschema/model_generator/field_factory.rb'
35
+ - 'lib/metaschema/model_generator/services/field_deserializer.rb'
174
36
  - 'lib/metaschema/ruby_source_emitter.rb'
175
37
  - 'spec/metaschema_spec.rb'
176
38
  - 'spec/model_generator_spec.rb'
177
39
  - 'spec/ruby_source_emitter_spec.rb'
178
40
 
179
41
  # Offense count: 2
180
- # This cop supports safe autocorrection (--autocorrect).
181
- Layout/MultilineBlockLayout:
182
- Exclude:
183
- - 'lib/metaschema/model_generator.rb'
184
-
185
- # Offense count: 5
186
- # This cop supports safe autocorrection (--autocorrect).
187
- # Configuration parameters: EnforcedStyle, IndentationWidth.
188
- # SupportedStyles: aligned, indented, indented_relative_to_receiver
189
- Layout/MultilineMethodCallIndentation:
190
- Exclude:
191
- - 'lib/metaschema/model_generator.rb'
192
- - 'lib/metaschema/ruby_source_emitter.rb'
193
-
194
- # Offense count: 7
195
- # This cop supports safe autocorrection (--autocorrect).
196
- # Configuration parameters: EnforcedStyle, IndentationWidth.
197
- # SupportedStyles: aligned, indented
198
- Layout/MultilineOperationIndentation:
199
- Exclude:
200
- - 'lib/metaschema/model_generator.rb'
201
-
202
- # Offense count: 57
203
- # This cop supports safe autocorrection (--autocorrect).
204
- # Configuration parameters: AllowInHeredoc.
205
- Layout/TrailingWhitespace:
206
- Exclude:
207
- - 'lib/metaschema/constraint_validator.rb'
208
- - 'lib/metaschema/json_schema_generator.rb'
209
- - 'lib/metaschema/markdown_doc_generator.rb'
210
- - 'lib/metaschema/metapath_evaluator.rb'
211
- - 'lib/metaschema/model_generator.rb'
212
- - 'lib/metaschema/ruby_source_emitter.rb'
213
- - 'spec/ruby_source_emitter_spec.rb'
214
-
215
- # Offense count: 4
216
42
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
217
43
  Lint/DuplicateBranch:
218
44
  Exclude:
219
45
  - 'lib/metaschema/constraint_validator.rb'
220
- - 'lib/metaschema/model_generator.rb'
46
+ - 'lib/metaschema/model_generator/assembly_factory.rb'
221
47
 
222
48
  # Offense count: 1
223
49
  Lint/IneffectiveAccessModifier:
224
50
  Exclude:
225
51
  - 'lib/metaschema/constraint_validator.rb'
226
52
 
227
- # Offense count: 6
228
- # This cop supports unsafe autocorrection (--autocorrect-all).
229
- # Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
230
- # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
231
- # AdditionalNilMethods: present?, blank?, try, try!
232
- Lint/RedundantSafeNavigation:
233
- Exclude:
234
- - 'lib/metaschema/json_schema_generator.rb'
235
- - 'lib/metaschema/markdown_doc_generator.rb'
236
- - 'lib/metaschema/model_generator.rb'
237
- - 'lib/metaschema/ruby_source_emitter.rb'
238
-
239
- # Offense count: 2
240
- # This cop supports safe autocorrection (--autocorrect).
241
- # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
242
- Lint/UnusedBlockArgument:
243
- Exclude:
244
- - 'lib/metaschema/model_generator.rb'
245
- - 'lib/metaschema/ruby_source_emitter.rb'
246
-
247
- # Offense count: 10
53
+ # Offense count: 1
248
54
  # This cop supports safe autocorrection (--autocorrect).
249
55
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
250
56
  # NotImplementedExceptions: NotImplementedError
251
57
  Lint/UnusedMethodArgument:
252
58
  Exclude:
253
- - 'lib/metaschema/constraint_validator.rb'
254
- - 'lib/metaschema/json_schema_generator.rb'
255
59
  - 'lib/metaschema/markdown_doc_generator.rb'
256
- - 'lib/metaschema/model_generator.rb'
257
- - 'lib/metaschema/ruby_source_emitter.rb'
258
-
259
- # Offense count: 1
260
- # This cop supports safe autocorrection (--autocorrect).
261
- # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
262
- Lint/UselessAccessModifier:
263
- Exclude:
264
- - 'lib/metaschema/constraint_validator.rb'
265
-
266
- # Offense count: 4
267
- # This cop supports safe autocorrection (--autocorrect).
268
- Lint/UselessAssignment:
269
- Exclude:
270
- - 'lib/metaschema/constraint_validator.rb'
271
- - 'lib/metaschema/json_schema_generator.rb'
272
- - 'lib/metaschema/model_generator.rb'
273
- - 'lib/metaschema/ruby_source_emitter.rb'
274
60
 
275
- # Offense count: 82
61
+ # Offense count: 84
276
62
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
277
63
  Metrics/AbcSize:
278
64
  Exclude:
@@ -281,16 +67,19 @@ Metrics/AbcSize:
281
67
  - 'lib/metaschema/markdown_doc_generator.rb'
282
68
  - 'lib/metaschema/metapath_evaluator.rb'
283
69
  - 'lib/metaschema/model_generator.rb'
70
+ - 'lib/metaschema/model_generator/assembly_factory.rb'
71
+ - 'lib/metaschema/model_generator/field_factory.rb'
72
+ - 'lib/metaschema/model_generator/services/field_serializer.rb'
284
73
  - 'lib/metaschema/ruby_source_emitter.rb'
285
74
  - 'lib/metaschema/type_mapper.rb'
286
75
 
287
- # Offense count: 15
76
+ # Offense count: 11
288
77
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
289
78
  # AllowedMethods: refine
290
79
  Metrics/BlockLength:
291
- Max: 52
80
+ Max: 46
292
81
 
293
- # Offense count: 86
82
+ # Offense count: 87
294
83
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
295
84
  Metrics/CyclomaticComplexity:
296
85
  Exclude:
@@ -299,19 +88,22 @@ Metrics/CyclomaticComplexity:
299
88
  - 'lib/metaschema/markdown_doc_generator.rb'
300
89
  - 'lib/metaschema/metapath_evaluator.rb'
301
90
  - 'lib/metaschema/model_generator.rb'
91
+ - 'lib/metaschema/model_generator/assembly_factory.rb'
92
+ - 'lib/metaschema/model_generator/field_factory.rb'
93
+ - 'lib/metaschema/model_generator/services/field_deserializer.rb'
302
94
  - 'lib/metaschema/ruby_source_emitter.rb'
303
95
 
304
- # Offense count: 106
96
+ # Offense count: 104
305
97
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
306
98
  Metrics/MethodLength:
307
- Max: 283
99
+ Max: 212
308
100
 
309
- # Offense count: 2
101
+ # Offense count: 4
310
102
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
311
103
  Metrics/ParameterLists:
312
104
  Max: 7
313
105
 
314
- # Offense count: 72
106
+ # Offense count: 74
315
107
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
316
108
  Metrics/PerceivedComplexity:
317
109
  Exclude:
@@ -320,6 +112,9 @@ Metrics/PerceivedComplexity:
320
112
  - 'lib/metaschema/markdown_doc_generator.rb'
321
113
  - 'lib/metaschema/metapath_evaluator.rb'
322
114
  - 'lib/metaschema/model_generator.rb'
115
+ - 'lib/metaschema/model_generator/assembly_factory.rb'
116
+ - 'lib/metaschema/model_generator/field_factory.rb'
117
+ - 'lib/metaschema/model_generator/services/field_deserializer.rb'
323
118
  - 'lib/metaschema/ruby_source_emitter.rb'
324
119
 
325
120
  # Offense count: 20
@@ -331,38 +126,22 @@ Naming/MethodParameterName:
331
126
  - 'lib/metaschema/markdown_doc_generator.rb'
332
127
  - 'lib/metaschema/metapath_evaluator.rb'
333
128
 
334
- # Offense count: 23
335
- # This cop supports unsafe autocorrection (--autocorrect-all).
336
- Performance/MapCompact:
337
- Exclude:
338
- - 'lib/metaschema/constraint_validator.rb'
339
- - 'lib/metaschema/json_schema_generator.rb'
340
- - 'lib/metaschema/markdown_doc_generator.rb'
341
- - 'lib/metaschema/model_generator.rb'
342
-
343
- # Offense count: 8
344
- # This cop supports safe autocorrection (--autocorrect).
345
- Performance/StringIdentifierArgument:
346
- Exclude:
347
- - 'lib/metaschema/model_generator.rb'
348
-
349
- # Offense count: 1
350
- # This cop supports unsafe autocorrection (--autocorrect-all).
351
- Performance/StringInclude:
352
- Exclude:
353
- - 'lib/metaschema/constraint_validator.rb'
354
-
355
129
  # Offense count: 1
356
130
  RSpec/DescribeMethod:
357
131
  Exclude:
358
132
  - 'spec/model_generator_spec.rb'
359
133
 
360
- # Offense count: 8
134
+ # Offense count: 15
361
135
  # Configuration parameters: CountAsOne.
362
136
  RSpec/ExampleLength:
363
- Max: 10
137
+ Max: 20
138
+
139
+ # Offense count: 1
140
+ RSpec/MultipleDescribes:
141
+ Exclude:
142
+ - 'spec/services_spec.rb'
364
143
 
365
- # Offense count: 9
144
+ # Offense count: 13
366
145
  RSpec/MultipleExpectations:
367
146
  Max: 2
368
147
 
@@ -379,190 +158,40 @@ RSpec/NoExpectationExample:
379
158
  - 'spec/metaschema_spec.rb'
380
159
 
381
160
  # Offense count: 2
382
- # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
383
- # SupportedInflectors: default, active_support
384
- RSpec/SpecFilePathFormat:
161
+ RSpec/RepeatedDescription:
385
162
  Exclude:
386
- - 'spec/model_generator_spec.rb'
387
- - 'spec/ruby_source_emitter_spec.rb'
163
+ - 'spec/type_mapper_spec.rb'
388
164
 
389
- # Offense count: 137
390
- # This cop supports safe autocorrection (--autocorrect).
391
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
392
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
393
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
394
- # FunctionalMethods: let, let!, subject, watch
395
- # AllowedMethods: lambda, proc, it
396
- Style/BlockDelimiters:
397
- Exclude:
398
- - 'lib/metaschema/constraint_validator.rb'
399
- - 'lib/metaschema/json_schema_generator.rb'
400
- - 'lib/metaschema/markdown_doc_generator.rb'
401
- - 'lib/metaschema/metapath_evaluator.rb'
402
- - 'lib/metaschema/model_generator.rb'
403
-
404
- # Offense count: 3
405
- # This cop supports unsafe autocorrection (--autocorrect-all).
406
- Style/CombinableLoops:
407
- Exclude:
408
- - 'lib/metaschema/model_generator.rb'
409
-
410
- # Offense count: 4
411
- # This cop supports safe autocorrection (--autocorrect).
412
- # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
413
- # SupportedStyles: assign_to_condition, assign_inside_condition
414
- Style/ConditionalAssignment:
415
- Exclude:
416
- - 'lib/metaschema/json_schema_generator.rb'
417
- - 'lib/metaschema/model_generator.rb'
418
- - 'lib/metaschema/ruby_source_emitter.rb'
419
-
420
- # Offense count: 1
421
- # This cop supports safe autocorrection (--autocorrect).
422
- # Configuration parameters: EnforcedStyle, AllowComments.
423
- # SupportedStyles: empty, nil, both
424
- Style/EmptyElse:
425
- Exclude:
426
- - 'lib/metaschema/ruby_source_emitter.rb'
427
-
428
- # Offense count: 3
429
- # This cop supports unsafe autocorrection (--autocorrect-all).
430
- # Configuration parameters: AllowedReceivers.
431
- # AllowedReceivers: Thread.current
432
- Style/HashEachMethods:
433
- Exclude:
434
- - 'lib/metaschema/constraint_validator.rb'
435
- - 'lib/metaschema/metapath_evaluator.rb'
436
- - 'lib/metaschema/ruby_source_emitter.rb'
437
-
438
- # Offense count: 1
439
- # This cop supports unsafe autocorrection (--autocorrect-all).
440
- Style/HashExcept:
441
- Exclude:
442
- - 'lib/metaschema/ruby_source_emitter.rb'
443
-
444
- # Offense count: 16
445
- # This cop supports unsafe autocorrection (--autocorrect-all).
446
- Style/IdenticalConditionalBranches:
165
+ # Offense count: 2
166
+ RSpec/RepeatedExample:
447
167
  Exclude:
448
- - 'lib/metaschema/model_generator.rb'
449
- - 'lib/metaschema/ruby_source_emitter.rb'
168
+ - 'spec/type_mapper_spec.rb'
450
169
 
451
170
  # Offense count: 3
452
- # This cop supports unsafe autocorrection (--autocorrect-all).
453
- Style/MapIntoArray:
454
- Exclude:
455
- - 'lib/metaschema/markdown_doc_generator.rb'
456
-
457
- # Offense count: 1
458
- # This cop supports safe autocorrection (--autocorrect).
459
- Style/ModuleMemberExistenceCheck:
460
- Exclude:
461
- - 'lib/metaschema/model_generator.rb'
462
-
463
- # Offense count: 18
464
- # This cop supports safe autocorrection (--autocorrect).
465
- Style/MultilineIfModifier:
466
- Exclude:
467
- - 'lib/metaschema/constraint_validator.rb'
468
- - 'lib/metaschema/model_generator.rb'
469
-
470
- # Offense count: 4
471
- # This cop supports safe autocorrection (--autocorrect).
472
- Style/MultilineTernaryOperator:
171
+ # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
172
+ # SupportedInflectors: default, active_support
173
+ RSpec/SpecFilePathFormat:
473
174
  Exclude:
474
- - 'lib/metaschema/constraint_validator.rb'
475
- - 'lib/metaschema/model_generator.rb'
175
+ - 'spec/model_generator_spec.rb'
176
+ - 'spec/ruby_source_emitter_spec.rb'
177
+ - 'spec/type_mapper_spec.rb'
476
178
 
477
179
  # Offense count: 1
478
- # This cop supports safe autocorrection (--autocorrect).
479
- # Configuration parameters: AllowMethodComparison, ComparisonsThreshold.
480
- Style/MultipleComparison:
180
+ Style/DocumentDynamicEvalDefinition:
481
181
  Exclude:
482
- - 'lib/metaschema/model_generator.rb'
483
-
484
- # Offense count: 6
485
- # This cop supports unsafe autocorrection (--autocorrect-all).
486
- # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
487
- # SupportedStyles: predicate, comparison
488
- Style/NumericPredicate:
489
- Exclude:
490
- - 'lib/metaschema/constraint_validator.rb'
491
- - 'lib/metaschema/markdown_doc_generator.rb'
492
- - 'lib/metaschema/metapath_evaluator.rb'
493
- - 'lib/metaschema/model_generator.rb'
182
+ - 'lib/metaschema/model_generator/utils.rb'
494
183
 
495
184
  # Offense count: 1
496
185
  # Configuration parameters: AllowedMethods.
497
186
  # AllowedMethods: respond_to_missing?
498
187
  Style/OptionalBooleanParameter:
499
188
  Exclude:
500
- - 'lib/metaschema/model_generator.rb'
501
-
502
- # Offense count: 1
503
- # This cop supports safe autocorrection (--autocorrect).
504
- Style/RedundantAssignment:
505
- Exclude:
506
- - 'lib/metaschema/metapath_evaluator.rb'
507
-
508
- # Offense count: 1
509
- # This cop supports safe autocorrection (--autocorrect).
510
- # Configuration parameters: AllowedMethods.
511
- # AllowedMethods: infinite?, nonzero?
512
- Style/RedundantCondition:
513
- Exclude:
514
- - 'lib/metaschema/model_generator.rb'
515
-
516
- # Offense count: 3
517
- # This cop supports safe autocorrection (--autocorrect).
518
- Style/RedundantParentheses:
519
- Exclude:
520
- - 'lib/metaschema/json_schema_generator.rb'
521
- - 'lib/metaschema/model_generator.rb'
522
-
523
- # Offense count: 1
524
- # This cop supports safe autocorrection (--autocorrect).
525
- # Configuration parameters: EnforcedStyle.
526
- # SupportedStyles: implicit, explicit
527
- Style/RescueStandardError:
528
- Exclude:
529
- - 'lib/metaschema/model_generator.rb'
189
+ - 'lib/metaschema/model_generator/field_factory.rb'
530
190
 
531
191
  # Offense count: 2
532
192
  # This cop supports unsafe autocorrection (--autocorrect-all).
533
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
534
- # AllowedMethods: present?, blank?, presence, try, try!
535
- Style/SafeNavigation:
536
- Exclude:
537
- - 'lib/metaschema/constraint_validator.rb'
538
- - 'lib/metaschema/ruby_source_emitter.rb'
539
-
540
- # Offense count: 1
541
- # This cop supports unsafe autocorrection (--autocorrect-all).
542
- Style/SlicingWithRange:
543
- Exclude:
544
- - 'lib/metaschema/constraint_validator.rb'
545
-
546
- # Offense count: 1
547
- # This cop supports safe autocorrection (--autocorrect).
548
- # Configuration parameters: AllowModifier.
549
- Style/SoleNestedConditional:
550
- Exclude:
551
- - 'lib/metaschema/model_generator.rb'
552
-
553
- # Offense count: 12
554
- # This cop supports unsafe autocorrection (--autocorrect-all).
555
193
  # Configuration parameters: Mode.
556
194
  Style/StringConcatenation:
557
195
  Exclude:
196
+ - 'lib/metaschema/model_generator/utils.rb'
558
197
  - 'lib/metaschema/ruby_source_emitter.rb'
559
-
560
- # Offense count: 4
561
- # This cop supports safe autocorrection (--autocorrect).
562
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
563
- # SupportedStyles: single_quotes, double_quotes
564
- Style/StringLiterals:
565
- Exclude:
566
- - 'lib/metaschema/constraint_validator.rb'
567
- - 'lib/metaschema/model_generator.rb'
568
- - 'spec/ruby_source_emitter_spec.rb'
data/README.adoc CHANGED
@@ -28,15 +28,16 @@ Metaschema-defined information models in the future.
28
28
 
29
29
  == Features
30
30
 
31
- TODO: This list is a TODO list. None of them have been completed.
32
-
33
31
  . Parse, build and round-trip Metaschema XML files
34
32
  . Validate Metaschema XML files against the Metaschema XML Schema
35
33
  . Generate XML (XSD) and JSON Schemas from Metaschema XML files
36
- . Generate Lutaml::Model (Ruby) classes that allow access and manipulation of
37
- Metaschema-defined information models.
34
+ . Generate `Lutaml::Model::Serializable` Ruby classes from Metaschema XML
35
+ definitions, with full XML and JSON round-trip fidelity
38
36
  . Validate Metaschema-defined information models against the Metaschema XML
39
37
  Schema
38
+ . Support for SINGLETON_OR_ARRAY field patterns via service object pipeline
39
+ (FieldSerializer / FieldDeserializer)
40
+ . UNWRAPPED XML field handling with delegate mappings
40
41
 
41
42
  == Installation
42
43
 
@@ -94,6 +95,55 @@ ms.assemblies
94
95
  # [Vendor, Computer, ...]
95
96
  ----
96
97
 
98
+ == Model Generation
99
+
100
+ The `Metaschema::ModelGenerator` generates Ruby classes from Metaschema XML
101
+ definitions. It uses a factory-based architecture:
102
+
103
+ [horizontal]
104
+ `ModelGenerator`:: Orchestrator — handles imports, augments, and delegates to factories
105
+ `FieldFactory`:: Creates field classes from Metaschema field definitions
106
+ `AssemblyFactory`:: Creates assembly classes with XML and JSON mappings
107
+ `FieldSerializer`:: Service object for normalizing field values to JSON
108
+ `FieldDeserializer`:: Service object for denormalizing JSON values to field instances
109
+ `CollapsiblesCollapser`:: Groups collapsible fields by shared flag values
110
+ `Utils`:: Shared naming and utility helpers
111
+
112
+ === Generating Ruby source
113
+
114
+ [source,ruby]
115
+ ----
116
+ # Generate a single Ruby file with all classes
117
+ source = Metaschema::ModelGenerator.to_ruby_source(
118
+ "oscal_complete_metaschema.xml",
119
+ module_name: "Oscal"
120
+ )
121
+
122
+ # Generate split files (one per class)
123
+ files = Metaschema::ModelGenerator.to_ruby_source(
124
+ "oscal_complete_metaschema.xml",
125
+ module_name: "Oscal",
126
+ split: true
127
+ )
128
+ ----
129
+
130
+ === Type System
131
+
132
+ The `TypeMapper` maps Metaschema data types to Ruby/Lutaml::Model types:
133
+
134
+ [horizontal]
135
+ `string`, `token`, `uri`, etc.:: `:string`
136
+ `integer`:: `:integer`
137
+ `boolean`:: `:boolean`
138
+ `date`, `date-time`:: `:date`, `:date_time`
139
+ `markup-line`:: `Metaschema::MarkupLineDatatype`
140
+ `markup-multiline`:: `Metaschema::MarkupMultilineDatatype`
141
+
142
+ === Dependencies
143
+
144
+ * `lutaml-model ~> 0.8.0` — serialization framework
145
+ * `moxml >= 0.1.15` — XML adapter (uses `namespace_validation_mode=` API)
146
+
97
147
 
98
148
  == Tests
99
149