metaschema 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec_status +64 -0
  3. data/.rubocop.yml +1 -0
  4. data/.rubocop_todo.yml +76 -0
  5. data/Rakefile +3 -3
  6. data/exe/metaschema +2 -2
  7. data/lib/metaschema/allowed_value_type.rb +24 -22
  8. data/lib/metaschema/allowed_values_type.rb +21 -19
  9. data/lib/metaschema/anchor_type.rb +19 -17
  10. data/lib/metaschema/any_type.rb +5 -3
  11. data/lib/metaschema/assembly.rb +24 -22
  12. data/lib/metaschema/assembly_model_type.rb +19 -17
  13. data/lib/metaschema/assembly_reference_type.rb +23 -21
  14. data/lib/metaschema/block_quote_type.rb +25 -23
  15. data/lib/metaschema/choice_type.rb +13 -11
  16. data/lib/metaschema/code_type.rb +23 -21
  17. data/lib/metaschema/constraint_let_type.rb +9 -7
  18. data/lib/metaschema/define_assembly_constraints_type.rb +23 -21
  19. data/lib/metaschema/define_field_constraints_type.rb +17 -15
  20. data/lib/metaschema/define_flag_constraints_type.rb +17 -15
  21. data/lib/metaschema/example_type.rb +11 -9
  22. data/lib/metaschema/expect_constraint_type.rb +17 -15
  23. data/lib/metaschema/field.rb +18 -16
  24. data/lib/metaschema/field_reference_type.rb +26 -24
  25. data/lib/metaschema/flag.rb +18 -16
  26. data/lib/metaschema/flag_reference_type.rb +20 -18
  27. data/lib/metaschema/global_assembly_definition_type.rb +33 -31
  28. data/lib/metaschema/global_field_definition_type.rb +37 -33
  29. data/lib/metaschema/global_flag_definition_type.rb +26 -24
  30. data/lib/metaschema/group_as_type.rb +10 -8
  31. data/lib/metaschema/grouped_assembly_reference_type.rb +17 -15
  32. data/lib/metaschema/grouped_choice_type.rb +23 -21
  33. data/lib/metaschema/grouped_field_reference_type.rb +17 -15
  34. data/lib/metaschema/grouped_inline_assembly_definition_type.rb +28 -26
  35. data/lib/metaschema/grouped_inline_field_definition_type.rb +35 -33
  36. data/lib/metaschema/image_type.rb +8 -6
  37. data/lib/metaschema/import.rb +6 -4
  38. data/lib/metaschema/index_has_key_constraint_type.rb +18 -16
  39. data/lib/metaschema/inline_assembly_definition_type.rb +35 -33
  40. data/lib/metaschema/inline_field_definition_type.rb +41 -39
  41. data/lib/metaschema/inline_flag_definition_type.rb +24 -22
  42. data/lib/metaschema/inline_markup_type.rb +19 -17
  43. data/lib/metaschema/insert_type.rb +7 -5
  44. data/lib/metaschema/json_key_type.rb +6 -4
  45. data/lib/metaschema/json_value_key_flag_type.rb +6 -4
  46. data/lib/metaschema/key_field.rb +9 -7
  47. data/lib/metaschema/list_item_type.rb +36 -34
  48. data/lib/metaschema/list_type.rb +7 -5
  49. data/lib/metaschema/markup_line_datatype.rb +22 -20
  50. data/lib/metaschema/matches_constraint_type.rb +17 -15
  51. data/lib/metaschema/metaschema_import_type.rb +6 -4
  52. data/lib/metaschema/metaschemaconstraints.rb +15 -13
  53. data/lib/metaschema/namespace_binding_type.rb +7 -5
  54. data/lib/metaschema/ordered_list_type.rb +7 -5
  55. data/lib/metaschema/preformatted_type.rb +22 -20
  56. data/lib/metaschema/property_type.rb +9 -7
  57. data/lib/metaschema/remarks_type.rb +28 -26
  58. data/lib/metaschema/root.rb +27 -25
  59. data/lib/metaschema/root_name.rb +6 -4
  60. data/lib/metaschema/scope.rb +13 -11
  61. data/lib/metaschema/table_cell_type.rb +24 -22
  62. data/lib/metaschema/table_row_type.rb +8 -6
  63. data/lib/metaschema/table_type.rb +7 -5
  64. data/lib/metaschema/targeted_allowed_values_constraint_type.rb +22 -20
  65. data/lib/metaschema/targeted_expect_constraint_type.rb +18 -16
  66. data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +18 -16
  67. data/lib/metaschema/targeted_index_constraint_type.rb +19 -17
  68. data/lib/metaschema/targeted_index_has_key_constraint_type.rb +19 -17
  69. data/lib/metaschema/targeted_key_constraint_type.rb +18 -16
  70. data/lib/metaschema/targeted_matches_constraint_type.rb +18 -16
  71. data/lib/metaschema/use_name_type.rb +6 -4
  72. data/lib/metaschema/version.rb +1 -1
  73. data/lib/metaschema.rb +4 -4
  74. metadata +9 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96ded33102abf61d6bebf9eeb5ae94432fa3ef93317d7cc63fefeada76cf3e1b
4
- data.tar.gz: fb9b812a3407d39927a7fb3d4955c902e3559338a393f0edeed8223212745803
3
+ metadata.gz: 64b2cc9bd51c2759ae43653efcea7545ff2220e028f157aeb0df32cafed795eb
4
+ data.tar.gz: 05034bac6e8b89d8bdd9a9af304260328091856b644c0a30d27aaaf3086d042d
5
5
  SHA512:
6
- metadata.gz: d4e7ea5033073e84c24375688b351f59be2c9b2787968160ab79f71a5c4e46346262710ff5952647529d0927b88d982d8c76ec178bf9e0a5b974e60e218a5405
7
- data.tar.gz: 6e3b3ee833410b6fa2398e7ada654e0f7ec3d3b1ff87a440d0cdef046b4d3379d28707799c1f0ed644ed6bb0a4ccefcf3a352f5c715c4a99bc14e85b0d9efac3
6
+ metadata.gz: 2bb0686cdde7fbd7095e96c515440a45bffaa3bb423fd57788d37264a59f9cb4e8d2843730761ba16f886b202d5f684a56aee771c306fde0eb0a7f1f4b78ab95
7
+ data.tar.gz: 5a75499492d19b3eaf5c5bb4f4f7189e3621275619a89cbf0a5a79a2d59c58bbad9d6bab87792cd9073085dd1143561ddb56b0730aaac5909b167f049a7ddca2
data/.rspec_status ADDED
@@ -0,0 +1,64 @@
1
+ example_id | status | run_time |
2
+ ----------------------------------- | ------ | --------------- |
3
+ ./spec/metaschema_spec.rb[1:1:1:1] | passed | 0.00694 seconds |
4
+ ./spec/metaschema_spec.rb[1:1:1:2] | passed | 0.00481 seconds |
5
+ ./spec/metaschema_spec.rb[1:1:2:1] | passed | 0.00441 seconds |
6
+ ./spec/metaschema_spec.rb[1:1:2:2] | passed | 0.00358 seconds |
7
+ ./spec/metaschema_spec.rb[1:1:3:1] | passed | 0.0022 seconds |
8
+ ./spec/metaschema_spec.rb[1:1:3:2] | passed | 0.00179 seconds |
9
+ ./spec/metaschema_spec.rb[1:1:4:1] | passed | 0.00314 seconds |
10
+ ./spec/metaschema_spec.rb[1:1:4:2] | passed | 0.00219 seconds |
11
+ ./spec/metaschema_spec.rb[1:1:5:1] | passed | 0.00289 seconds |
12
+ ./spec/metaschema_spec.rb[1:1:5:2] | passed | 0.002 seconds |
13
+ ./spec/metaschema_spec.rb[1:1:6:1] | passed | 0.0042 seconds |
14
+ ./spec/metaschema_spec.rb[1:1:6:2] | passed | 0.00309 seconds |
15
+ ./spec/metaschema_spec.rb[1:1:7:1] | passed | 0.00576 seconds |
16
+ ./spec/metaschema_spec.rb[1:1:7:2] | passed | 0.00391 seconds |
17
+ ./spec/metaschema_spec.rb[1:1:8:1] | passed | 0.00269 seconds |
18
+ ./spec/metaschema_spec.rb[1:1:8:2] | passed | 0.00189 seconds |
19
+ ./spec/metaschema_spec.rb[1:1:9:1] | passed | 0.00346 seconds |
20
+ ./spec/metaschema_spec.rb[1:1:9:2] | passed | 0.00259 seconds |
21
+ ./spec/metaschema_spec.rb[1:1:10:1] | passed | 0.00244 seconds |
22
+ ./spec/metaschema_spec.rb[1:1:10:2] | passed | 0.00228 seconds |
23
+ ./spec/metaschema_spec.rb[1:1:11:1] | passed | 0.00318 seconds |
24
+ ./spec/metaschema_spec.rb[1:1:11:2] | passed | 0.00254 seconds |
25
+ ./spec/metaschema_spec.rb[1:1:12:1] | passed | 0.00298 seconds |
26
+ ./spec/metaschema_spec.rb[1:1:12:2] | passed | 0.00275 seconds |
27
+ ./spec/metaschema_spec.rb[1:1:13:1] | passed | 0.00334 seconds |
28
+ ./spec/metaschema_spec.rb[1:1:13:2] | passed | 0.00253 seconds |
29
+ ./spec/metaschema_spec.rb[1:1:14:1] | passed | 0.0035 seconds |
30
+ ./spec/metaschema_spec.rb[1:1:14:2] | passed | 0.00255 seconds |
31
+ ./spec/metaschema_spec.rb[1:1:15:1] | passed | 0.00547 seconds |
32
+ ./spec/metaschema_spec.rb[1:1:15:2] | passed | 0.00424 seconds |
33
+ ./spec/metaschema_spec.rb[1:1:16:1] | passed | 0.00248 seconds |
34
+ ./spec/metaschema_spec.rb[1:1:16:2] | passed | 0.00201 seconds |
35
+ ./spec/metaschema_spec.rb[1:1:17:1] | passed | 0.00249 seconds |
36
+ ./spec/metaschema_spec.rb[1:1:17:2] | passed | 0.00185 seconds |
37
+ ./spec/metaschema_spec.rb[1:1:18:1] | passed | 0.00229 seconds |
38
+ ./spec/metaschema_spec.rb[1:1:18:2] | passed | 0.00182 seconds |
39
+ ./spec/metaschema_spec.rb[1:1:19:1] | passed | 0.00252 seconds |
40
+ ./spec/metaschema_spec.rb[1:1:19:2] | passed | 0.00183 seconds |
41
+ ./spec/metaschema_spec.rb[1:1:20:1] | passed | 0.00284 seconds |
42
+ ./spec/metaschema_spec.rb[1:1:20:2] | passed | 0.00204 seconds |
43
+ ./spec/metaschema_spec.rb[1:1:21:1] | passed | 0.00755 seconds |
44
+ ./spec/metaschema_spec.rb[1:1:21:2] | passed | 0.00568 seconds |
45
+ ./spec/metaschema_spec.rb[1:1:22:1] | passed | 0.00272 seconds |
46
+ ./spec/metaschema_spec.rb[1:1:22:2] | passed | 0.0018 seconds |
47
+ ./spec/metaschema_spec.rb[1:1:23:1] | passed | 0.0024 seconds |
48
+ ./spec/metaschema_spec.rb[1:1:23:2] | passed | 0.00169 seconds |
49
+ ./spec/metaschema_spec.rb[1:1:24:1] | passed | 0.0039 seconds |
50
+ ./spec/metaschema_spec.rb[1:1:24:2] | passed | 0.0032 seconds |
51
+ ./spec/metaschema_spec.rb[1:1:25:1] | passed | 0.00356 seconds |
52
+ ./spec/metaschema_spec.rb[1:1:25:2] | passed | 0.0026 seconds |
53
+ ./spec/metaschema_spec.rb[1:1:26:1] | passed | 0.00482 seconds |
54
+ ./spec/metaschema_spec.rb[1:1:26:2] | passed | 0.00368 seconds |
55
+ ./spec/metaschema_spec.rb[1:1:27:1] | passed | 0.00508 seconds |
56
+ ./spec/metaschema_spec.rb[1:1:27:2] | passed | 0.00346 seconds |
57
+ ./spec/metaschema_spec.rb[1:1:28:1] | passed | 0.00368 seconds |
58
+ ./spec/metaschema_spec.rb[1:1:28:2] | passed | 0.00311 seconds |
59
+ ./spec/metaschema_spec.rb[1:1:29:1] | passed | 0.0038 seconds |
60
+ ./spec/metaschema_spec.rb[1:1:29:2] | passed | 0.00259 seconds |
61
+ ./spec/metaschema_spec.rb[1:1:30:1] | passed | 0.00279 seconds |
62
+ ./spec/metaschema_spec.rb[1:1:30:2] | passed | 0.002 seconds |
63
+ ./spec/metaschema_spec.rb[1:1:31:1] | passed | 0.02414 seconds |
64
+ ./spec/metaschema_spec.rb[1:1:31:2] | passed | 0.01733 seconds |
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,76 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2024-10-28 08:35:06 UTC using RuboCop version 1.67.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 2
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: EnforcedStyle.
12
+ # SupportedStyles: leading, trailing
13
+ Layout/DotPosition:
14
+ Exclude:
15
+ - 'spec/metaschema_spec.rb'
16
+
17
+ # Offense count: 65
18
+ # This cop supports safe autocorrection (--autocorrect).
19
+ Layout/EmptyLineAfterMagicComment:
20
+ Enabled: false
21
+
22
+ # Offense count: 2
23
+ # This cop supports safe autocorrection (--autocorrect).
24
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
25
+ # SupportedStyles: aligned, indented, indented_relative_to_receiver
26
+ Layout/MultilineMethodCallIndentation:
27
+ Exclude:
28
+ - 'spec/metaschema_spec.rb'
29
+
30
+ # Offense count: 3
31
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
32
+ # AllowedMethods: refine
33
+ Metrics/BlockLength:
34
+ Max: 44
35
+
36
+ # Offense count: 66
37
+ # Configuration parameters: AllowedConstants.
38
+ Style/Documentation:
39
+ Enabled: false
40
+
41
+ # Offense count: 65
42
+ # This cop supports unsafe autocorrection (--autocorrect-all).
43
+ # Configuration parameters: EnforcedStyle.
44
+ # SupportedStyles: always, always_true, never
45
+ Style/FrozenStringLiteralComment:
46
+ Enabled: false
47
+
48
+ # Offense count: 2
49
+ # This cop supports unsafe autocorrection (--autocorrect-all).
50
+ # Configuration parameters: EnforcedStyle.
51
+ # SupportedStyles: literals, strict
52
+ Style/MutableConstant:
53
+ Exclude:
54
+ - 'split_files.rb'
55
+
56
+ # Offense count: 1
57
+ # This cop supports safe autocorrection (--autocorrect).
58
+ # Configuration parameters: PreferredDelimiters.
59
+ Style/PercentLiteralDelimiters:
60
+ Exclude:
61
+ - 'spec/metaschema_spec.rb'
62
+
63
+ # Offense count: 1120
64
+ # This cop supports safe autocorrection (--autocorrect).
65
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
66
+ # SupportedStyles: single_quotes, double_quotes
67
+ Style/StringLiterals:
68
+ Enabled: false
69
+
70
+ # Offense count: 2
71
+ # This cop supports safe autocorrection (--autocorrect).
72
+ # Configuration parameters: EnforcedStyleForMultiline.
73
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
74
+ Style/TrailingCommaInArguments:
75
+ Exclude:
76
+ - 'spec/metaschema_spec.rb'
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- require "rubocop/rake_task"
8
+ require 'rubocop/rake_task'
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
data/exe/metaschema CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require_relative "../lib/metaschema"
5
- require_relative "../lib/metaschema/cli"
4
+ require_relative '../lib/metaschema'
5
+ require_relative '../lib/metaschema/cli'
6
6
 
7
7
  Metaschema::Cli::Commands.start(ARGV)
@@ -1,10 +1,12 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "anchor_type"
4
- require_relative "code_type"
5
- require_relative "image_type"
6
- require_relative "inline_markup_type"
7
- require_relative "insert_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'anchor_type'
6
+ require_relative 'code_type'
7
+ require_relative 'image_type'
8
+ require_relative 'inline_markup_type'
9
+ require_relative 'insert_type'
8
10
 
9
11
  module Metaschema
10
12
  class AllowedValueType < Lutaml::Model::Serializable
@@ -25,24 +27,24 @@ module Metaschema
25
27
  attribute :img, ImageType, collection: true
26
28
 
27
29
  xml do
28
- root "AllowedValueType"
29
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
30
+ root 'AllowedValueType', mixed: true
31
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
30
32
 
31
33
  map_content to: :content
32
- map_attribute "value", to: :value
33
- map_attribute "deprecated", to: :deprecated
34
- map_element "a", to: :a
35
- map_element "insert", to: :insert
36
- map_element "br", to: :br
37
- map_element "code", to: :code
38
- map_element "em", to: :em
39
- map_element "i", to: :i
40
- map_element "b", to: :b
41
- map_element "strong", to: :strong
42
- map_element "sub", to: :sub
43
- map_element "sup", to: :sup
44
- map_element "q", to: :q
45
- map_element "img", to: :img
34
+ map_attribute 'value', to: :value
35
+ map_attribute 'deprecated', to: :deprecated
36
+ map_element 'a', to: :a
37
+ map_element 'insert', to: :insert
38
+ map_element 'br', to: :br
39
+ map_element 'code', to: :code
40
+ map_element 'em', to: :em
41
+ map_element 'i', to: :i
42
+ map_element 'b', to: :b
43
+ map_element 'strong', to: :strong
44
+ map_element 'sub', to: :sub
45
+ map_element 'sup', to: :sup
46
+ map_element 'q', to: :q
47
+ map_element 'img', to: :img
46
48
  end
47
49
  end
48
50
  end
@@ -1,16 +1,18 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "allowed_value_type"
4
- require_relative "markup_line_datatype"
5
- require_relative "property_type"
6
- require_relative "remarks_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'allowed_value_type'
6
+ require_relative 'markup_line_datatype'
7
+ require_relative 'property_type'
8
+ require_relative 'remarks_type'
7
9
 
8
10
  module Metaschema
9
11
  class AllowedValuesType < Lutaml::Model::Serializable
10
12
  attribute :id, :string
11
- attribute :level, :string, default: -> { "ERROR" }
12
- attribute :allow_other, :string, default: -> { "no" }
13
- attribute :extensible, :string, default: -> { "external" }
13
+ attribute :level, :string, default: -> { 'ERROR' }
14
+ attribute :allow_other, :string, default: -> { 'no' }
15
+ attribute :extensible, :string, default: -> { 'external' }
14
16
  attribute :formal_name, :string
15
17
  attribute :description, MarkupLineDatatype
16
18
  attribute :prop, PropertyType, collection: true
@@ -18,18 +20,18 @@ module Metaschema
18
20
  attribute :remarks, RemarksType
19
21
 
20
22
  xml do
21
- root "AllowedValuesType"
22
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
23
+ root 'AllowedValuesType'
24
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
23
25
 
24
- map_attribute "id", to: :id
25
- map_attribute "level", to: :level
26
- map_attribute "allow-other", to: :allow_other
27
- map_attribute "extensible", to: :extensible
28
- map_element "formal-name", to: :formal_name
29
- map_element "description", to: :description
30
- map_element "prop", to: :prop
31
- map_element "enum", to: :enum
32
- map_element "remarks", to: :remarks
26
+ map_attribute 'id', to: :id
27
+ map_attribute 'level', to: :level
28
+ map_attribute 'allow-other', to: :allow_other
29
+ map_attribute 'extensible', to: :extensible
30
+ map_element 'formal-name', to: :formal_name
31
+ map_element 'description', to: :description
32
+ map_element 'prop', to: :prop
33
+ map_element 'enum', to: :enum
34
+ map_element 'remarks', to: :remarks
33
35
  end
34
36
  end
35
37
  end
@@ -1,8 +1,10 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "code_type"
4
- require_relative "image_type"
5
- require_relative "inline_markup_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'code_type'
6
+ require_relative 'image_type'
7
+ require_relative 'inline_markup_type'
6
8
 
7
9
  module Metaschema
8
10
  class AnchorType < Lutaml::Model::Serializable
@@ -20,21 +22,21 @@ module Metaschema
20
22
  attribute :img, ImageType, collection: true
21
23
 
22
24
  xml do
23
- root "anchorType"
24
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
25
+ root 'anchorType', mixed: true
26
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
25
27
 
26
28
  map_content to: :content
27
- map_attribute "href", to: :href
28
- map_attribute "title", to: :title
29
- map_element "code", to: :code
30
- map_element "em", to: :em
31
- map_element "i", to: :i
32
- map_element "b", to: :b
33
- map_element "strong", to: :strong
34
- map_element "sub", to: :sub
35
- map_element "sup", to: :sup
36
- map_element "q", to: :q
37
- map_element "img", to: :img
29
+ map_attribute 'href', to: :href
30
+ map_attribute 'title', to: :title
31
+ map_element 'code', to: :code
32
+ map_element 'em', to: :em
33
+ map_element 'i', to: :i
34
+ map_element 'b', to: :b
35
+ map_element 'strong', to: :strong
36
+ map_element 'sub', to: :sub
37
+ map_element 'sup', to: :sup
38
+ map_element 'q', to: :q
39
+ map_element 'img', to: :img
38
40
  end
39
41
  end
40
42
  end
@@ -1,10 +1,12 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
+
3
+ require 'lutaml/model'
2
4
 
3
5
  module Metaschema
4
6
  class AnyType < Lutaml::Model::Serializable
5
7
  xml do
6
- root "AnyType"
7
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
8
+ root 'AnyType'
9
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
8
10
  end
9
11
  end
10
12
  end
@@ -1,14 +1,16 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "constraint_let_type"
4
- require_relative "remarks_type"
5
- require_relative "targeted_allowed_values_constraint_type"
6
- require_relative "targeted_expect_constraint_type"
7
- require_relative "targeted_has_cardinality_constraint_type"
8
- require_relative "targeted_index_constraint_type"
9
- require_relative "targeted_index_has_key_constraint_type"
10
- require_relative "targeted_key_constraint_type"
11
- require_relative "targeted_matches_constraint_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'constraint_let_type'
6
+ require_relative 'remarks_type'
7
+ require_relative 'targeted_allowed_values_constraint_type'
8
+ require_relative 'targeted_expect_constraint_type'
9
+ require_relative 'targeted_has_cardinality_constraint_type'
10
+ require_relative 'targeted_index_constraint_type'
11
+ require_relative 'targeted_index_has_key_constraint_type'
12
+ require_relative 'targeted_key_constraint_type'
13
+ require_relative 'targeted_matches_constraint_type'
12
14
 
13
15
  module Metaschema
14
16
  class Assembly < Lutaml::Model::Serializable
@@ -24,19 +26,19 @@ module Metaschema
24
26
  attribute :remarks, RemarksType
25
27
 
26
28
  xml do
27
- root "assembly"
28
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
29
+ root 'assembly'
30
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
29
31
 
30
- map_attribute "target", to: :target
31
- map_element "let", to: :let
32
- map_element "allowed-values", to: :allowed_values
33
- map_element "matches", to: :matches
34
- map_element "index-has-key", to: :index_has_key
35
- map_element "expect", to: :expect
36
- map_element "index", to: :index
37
- map_element "is-unique", to: :is_unique
38
- map_element "has-cardinality", to: :has_cardinality
39
- map_element "remarks", to: :remarks
32
+ map_attribute 'target', to: :target
33
+ map_element 'let', to: :let
34
+ map_element 'is-unique', to: :is_unique
35
+ map_element 'allowed-values', to: :allowed_values
36
+ map_element 'matches', to: :matches
37
+ map_element 'index-has-key', to: :index_has_key
38
+ map_element 'expect', to: :expect
39
+ map_element 'index', to: :index
40
+ map_element 'has-cardinality', to: :has_cardinality
41
+ map_element 'remarks', to: :remarks
40
42
  end
41
43
  end
42
44
  end
@@ -1,12 +1,14 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "any_type"
4
- require_relative "assembly_reference_type"
5
- require_relative "choice_type"
6
- require_relative "field_reference_type"
7
- require_relative "grouped_choice_type"
8
- require_relative "inline_assembly_definition_type"
9
- require_relative "inline_field_definition_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'any_type'
6
+ require_relative 'assembly_reference_type'
7
+ require_relative 'choice_type'
8
+ require_relative 'field_reference_type'
9
+ require_relative 'grouped_choice_type'
10
+ require_relative 'inline_assembly_definition_type'
11
+ require_relative 'inline_field_definition_type'
10
12
 
11
13
  module Metaschema
12
14
  class AssemblyModelType < Lutaml::Model::Serializable
@@ -19,16 +21,16 @@ module Metaschema
19
21
  attribute :any, AnyType
20
22
 
21
23
  xml do
22
- root "AssemblyModelType"
23
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
24
+ root 'AssemblyModelType', ordered: true
25
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
24
26
 
25
- map_element "assembly", to: :assembly
26
- map_element "field", to: :field
27
- map_element "define-assembly", to: :define_assembly
28
- map_element "define-field", to: :define_field
29
- map_element "choice", to: :choice
30
- map_element "choice-group", to: :choice_group
31
- map_element "any", to: :any
27
+ map_element 'field', to: :field
28
+ map_element 'define-assembly', to: :define_assembly
29
+ map_element 'assembly', to: :assembly
30
+ map_element 'define-field', to: :define_field
31
+ map_element 'choice', to: :choice
32
+ map_element 'choice-group', to: :choice_group
33
+ map_element 'any', to: :any
32
34
  end
33
35
  end
34
36
  end
@@ -1,17 +1,19 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "group_as_type"
4
- require_relative "markup_line_datatype"
5
- require_relative "property_type"
6
- require_relative "remarks_type"
7
- require_relative "use_name_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'group_as_type'
6
+ require_relative 'markup_line_datatype'
7
+ require_relative 'property_type'
8
+ require_relative 'remarks_type'
9
+ require_relative 'use_name_type'
8
10
 
9
11
  module Metaschema
10
12
  class AssemblyReferenceType < Lutaml::Model::Serializable
11
13
  attribute :ref, :string
12
14
  attribute :index, :integer
13
- attribute :min_occurs, :integer, default: -> { "0" }
14
- attribute :max_occurs, :string, default: -> { "1" }
15
+ attribute :min_occurs, :integer, default: -> { '0' }
16
+ attribute :max_occurs, :string, default: -> { '1' }
15
17
  attribute :deprecated, :string
16
18
  attribute :formal_name, :string
17
19
  attribute :description, MarkupLineDatatype
@@ -21,20 +23,20 @@ module Metaschema
21
23
  attribute :remarks, RemarksType
22
24
 
23
25
  xml do
24
- root "AssemblyReferenceType"
25
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
26
+ root 'AssemblyReferenceType'
27
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
26
28
 
27
- map_attribute "ref", to: :ref
28
- map_attribute "index", to: :index
29
- map_attribute "min-occurs", to: :min_occurs
30
- map_attribute "max-occurs", to: :max_occurs
31
- map_attribute "deprecated", to: :deprecated
32
- map_element "formal-name", to: :formal_name
33
- map_element "description", to: :description
34
- map_element "prop", to: :prop
35
- map_element "use-name", to: :use_name
36
- map_element "group-as", to: :group_as
37
- map_element "remarks", to: :remarks
29
+ map_attribute 'ref', to: :ref
30
+ map_attribute 'index', to: :index
31
+ map_attribute 'min-occurs', to: :min_occurs
32
+ map_attribute 'max-occurs', to: :max_occurs
33
+ map_attribute 'deprecated', to: :deprecated
34
+ map_element 'formal-name', to: :formal_name
35
+ map_element 'description', to: :description
36
+ map_element 'prop', to: :prop
37
+ map_element 'use-name', to: :use_name
38
+ map_element 'group-as', to: :group_as
39
+ map_element 'remarks', to: :remarks
38
40
  end
39
41
  end
40
42
  end
@@ -1,11 +1,13 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "image_type"
4
- require_relative "inline_markup_type"
5
- require_relative "list_type"
6
- require_relative "ordered_list_type"
7
- require_relative "preformatted_type"
8
- require_relative "table_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'image_type'
6
+ require_relative 'inline_markup_type'
7
+ require_relative 'list_type'
8
+ require_relative 'ordered_list_type'
9
+ require_relative 'preformatted_type'
10
+ require_relative 'table_type'
9
11
 
10
12
  module Metaschema
11
13
  class BlockQuoteType < Lutaml::Model::Serializable
@@ -25,23 +27,23 @@ module Metaschema
25
27
  attribute :img, ImageType, collection: true
26
28
 
27
29
  xml do
28
- root "blockQuoteType"
29
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
30
+ root 'blockQuoteType', mixed: true
31
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
30
32
 
31
- map_element "h1", to: :h1
32
- map_element "h2", to: :h2
33
- map_element "h3", to: :h3
34
- map_element "h4", to: :h4
35
- map_element "h5", to: :h5
36
- map_element "h6", to: :h6
37
- map_element "ul", to: :ul
38
- map_element "ol", to: :ol
39
- map_element "pre", to: :pre
40
- map_element "hr", to: :hr
41
- map_element "blockquote", to: :blockquote
42
- map_element "p", to: :p
43
- map_element "table", to: :table
44
- map_element "img", to: :img
33
+ map_element 'h1', to: :h1
34
+ map_element 'h2', to: :h2
35
+ map_element 'h3', to: :h3
36
+ map_element 'h4', to: :h4
37
+ map_element 'h5', to: :h5
38
+ map_element 'h6', to: :h6
39
+ map_element 'ul', to: :ul
40
+ map_element 'ol', to: :ol
41
+ map_element 'pre', to: :pre
42
+ map_element 'hr', to: :hr
43
+ map_element 'blockquote', to: :blockquote
44
+ map_element 'p', to: :p
45
+ map_element 'table', to: :table
46
+ map_element 'img', to: :img
45
47
  end
46
48
  end
47
49
  end
@@ -1,9 +1,11 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "assembly_reference_type"
4
- require_relative "field_reference_type"
5
- require_relative "inline_assembly_definition_type"
6
- require_relative "inline_field_definition_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'assembly_reference_type'
6
+ require_relative 'field_reference_type'
7
+ require_relative 'inline_assembly_definition_type'
8
+ require_relative 'inline_field_definition_type'
7
9
 
8
10
  module Metaschema
9
11
  class ChoiceType < Lutaml::Model::Serializable
@@ -13,13 +15,13 @@ module Metaschema
13
15
  attribute :define_field, InlineFieldDefinitionType, collection: true
14
16
 
15
17
  xml do
16
- root "ChoiceType"
17
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
18
+ root 'ChoiceType'
19
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
18
20
 
19
- map_element "assembly", to: :assembly
20
- map_element "field", to: :field
21
- map_element "define-assembly", to: :define_assembly
22
- map_element "define-field", to: :define_field
21
+ map_element 'field', to: :field
22
+ map_element 'define-assembly', to: :define_assembly
23
+ map_element 'assembly', to: :assembly
24
+ map_element 'define-field', to: :define_field
23
25
  end
24
26
  end
25
27
  end