metaschema 0.1.2 → 0.2.0

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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +19 -1
  3. data/.rubocop_todo.yml +60 -8
  4. data/CLAUDE.md +78 -0
  5. data/Rakefile +3 -3
  6. data/exe/metaschema +1 -2
  7. data/lib/metaschema/allowed_value_type.rb +17 -24
  8. data/lib/metaschema/allowed_values_type.rb +15 -22
  9. data/lib/metaschema/anchor_type.rb +14 -19
  10. data/lib/metaschema/any_type.rb +2 -4
  11. data/lib/metaschema/assembly.rb +18 -27
  12. data/lib/metaschema/assembly_model_type.rb +10 -19
  13. data/lib/metaschema/assembly_reference_type.rb +16 -24
  14. data/lib/metaschema/block_quote_type.rb +17 -25
  15. data/lib/metaschema/choice_type.rb +6 -13
  16. data/lib/metaschema/code_type.rb +16 -22
  17. data/lib/metaschema/constraint_let_type.rb +5 -9
  18. data/lib/metaschema/define_assembly_constraints_type.rb +17 -26
  19. data/lib/metaschema/define_field_constraints_type.rb +13 -19
  20. data/lib/metaschema/define_flag_constraints_type.rb +9 -17
  21. data/lib/metaschema/example_type.rb +6 -11
  22. data/lib/metaschema/expect_constraint_type.rb +12 -18
  23. data/lib/metaschema/field.rb +13 -20
  24. data/lib/metaschema/field_reference_type.rb +19 -27
  25. data/lib/metaschema/flag.rb +9 -18
  26. data/lib/metaschema/flag_reference_type.rb +14 -21
  27. data/lib/metaschema/formal_name.rb +9 -0
  28. data/lib/metaschema/global_assembly_definition_type.rb +21 -34
  29. data/lib/metaschema/global_field_definition_type.rb +26 -39
  30. data/lib/metaschema/global_flag_definition_type.rb +18 -27
  31. data/lib/metaschema/group_as_type.rb +7 -9
  32. data/lib/metaschema/grouped_assembly_reference_type.rb +11 -18
  33. data/lib/metaschema/grouped_choice_type.rb +16 -24
  34. data/lib/metaschema/grouped_field_reference_type.rb +11 -18
  35. data/lib/metaschema/grouped_inline_assembly_definition_type.rb +17 -29
  36. data/lib/metaschema/grouped_inline_field_definition_type.rb +26 -37
  37. data/lib/metaschema/image_type.rb +5 -7
  38. data/lib/metaschema/import.rb +3 -5
  39. data/lib/metaschema/index_has_key_constraint_type.rb +12 -19
  40. data/lib/metaschema/inline_assembly_definition_type.rb +25 -38
  41. data/lib/metaschema/inline_field_definition_type.rb +31 -43
  42. data/lib/metaschema/inline_flag_definition_type.rb +17 -25
  43. data/lib/metaschema/inline_markup_type.rb +16 -21
  44. data/lib/metaschema/insert_type.rb +4 -6
  45. data/lib/metaschema/json_base_uri.rb +9 -0
  46. data/lib/metaschema/json_key_type.rb +3 -5
  47. data/lib/metaschema/json_value_key.rb +9 -0
  48. data/lib/metaschema/json_value_key_flag_type.rb +3 -5
  49. data/lib/metaschema/key_field.rb +5 -9
  50. data/lib/metaschema/list_item_type.rb +28 -38
  51. data/lib/metaschema/list_type.rb +3 -7
  52. data/lib/metaschema/markup_line_datatype.rb +15 -22
  53. data/lib/metaschema/matches_constraint_type.rb +12 -18
  54. data/lib/metaschema/metaschema_constraints.rb +24 -0
  55. data/lib/metaschema/metaschema_import_type.rb +3 -5
  56. data/lib/metaschema/namespace.rb +8 -0
  57. data/lib/metaschema/namespace_binding_type.rb +4 -6
  58. data/lib/metaschema/namespace_value.rb +9 -0
  59. data/lib/metaschema/ordered_list_type.rb +4 -8
  60. data/lib/metaschema/preformatted_type.rb +15 -22
  61. data/lib/metaschema/property_type.rb +6 -8
  62. data/lib/metaschema/remarks_type.rb +18 -27
  63. data/lib/metaschema/root.rb +21 -31
  64. data/lib/metaschema/root_name.rb +3 -5
  65. data/lib/metaschema/schema_version.rb +9 -0
  66. data/lib/metaschema/scope.rb +7 -13
  67. data/lib/metaschema/short_name.rb +9 -0
  68. data/lib/metaschema/table_cell_type.rb +17 -24
  69. data/lib/metaschema/table_row_type.rb +4 -8
  70. data/lib/metaschema/table_type.rb +3 -7
  71. data/lib/metaschema/targeted_allowed_values_constraint_type.rb +16 -23
  72. data/lib/metaschema/targeted_expect_constraint_type.rb +13 -19
  73. data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +13 -19
  74. data/lib/metaschema/targeted_index_constraint_type.rb +13 -20
  75. data/lib/metaschema/targeted_index_has_key_constraint_type.rb +13 -20
  76. data/lib/metaschema/targeted_key_constraint_type.rb +12 -19
  77. data/lib/metaschema/targeted_matches_constraint_type.rb +13 -19
  78. data/lib/metaschema/use_name_type.rb +3 -5
  79. data/lib/metaschema/version.rb +1 -1
  80. data/lib/metaschema.rb +89 -9
  81. metadata +20 -95
  82. data/lib/metaschema/metaschemaconstraints.rb +0 -31
@@ -1,33 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- # require_relative "assembly_model_type"
6
- require_relative 'define_assembly_constraints_type'
7
- require_relative 'example_type'
8
- require_relative 'flag_reference_type'
9
- require_relative 'group_as_type'
10
- require_relative 'inline_flag_definition_type'
11
- require_relative 'json_key_type'
12
- require_relative 'json_value_key_flag_type'
13
- require_relative 'markup_line_datatype'
14
- require_relative 'property_type'
15
- require_relative 'remarks_type'
16
-
17
3
  module Metaschema
18
4
  class AssemblyModelType < Lutaml::Model::Serializable; end
19
5
 
20
6
  class InlineAssemblyDefinitionType < Lutaml::Model::Serializable
21
- attribute :min_occurs, :integer, default: -> { '0' }
22
- attribute :max_occurs, :string, default: -> { '1' }
7
+ attribute :min_occurs, :integer, default: -> { "0" }
8
+ attribute :max_occurs, :string, default: -> { "1" }
23
9
  attribute :name, :string
24
10
  attribute :index, :integer
25
11
  attribute :deprecated, :string
26
- attribute :formal_name, :string
12
+ attribute :formal_name, FormalName
27
13
  attribute :description, MarkupLineDatatype
28
14
  attribute :prop, PropertyType, collection: true
29
15
  attribute :json_key, JsonKeyType
30
- attribute :json_value_key, :string
16
+ attribute :json_value_key, JsonValueKey
17
+
31
18
  attribute :json_value_key_flag, JsonValueKeyFlagType
32
19
  attribute :group_as, GroupAsType
33
20
  attribute :flag, FlagReferenceType, collection: true
@@ -38,27 +25,27 @@ module Metaschema
38
25
  attribute :example, ExampleType, collection: true
39
26
 
40
27
  xml do
41
- root 'InlineAssemblyDefinitionType'
42
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
28
+ element "InlineAssemblyDefinitionType"
29
+ namespace ::Metaschema::Namespace
43
30
 
44
- map_attribute 'min-occurs', to: :min_occurs
45
- map_attribute 'max-occurs', to: :max_occurs
46
- map_attribute 'name', to: :name
47
- map_attribute 'index', to: :index
48
- map_attribute 'deprecated', to: :deprecated
49
- map_element 'formal-name', to: :formal_name
50
- map_element 'description', to: :description
51
- map_element 'prop', to: :prop
52
- map_element 'json-key', to: :json_key
53
- map_element 'json-value-key', to: :json_value_key
54
- map_element 'json-value-key-flag', to: :json_value_key_flag
55
- map_element 'group-as', to: :group_as
56
- map_element 'flag', to: :flag
57
- map_element 'define-flag', to: :define_flag
58
- map_element 'model', to: :model
59
- map_element 'constraint', to: :constraint
60
- map_element 'remarks', to: :remarks
61
- map_element 'example', to: :example
31
+ map_attribute "min-occurs", to: :min_occurs
32
+ map_attribute "max-occurs", to: :max_occurs
33
+ map_attribute "name", to: :name
34
+ map_attribute "index", to: :index
35
+ map_attribute "deprecated", to: :deprecated
36
+ map_element "formal-name", to: :formal_name
37
+ map_element "description", to: :description
38
+ map_element "prop", to: :prop
39
+ map_element "json-key", to: :json_key
40
+ map_element "json-value-key", to: :json_value_key
41
+ map_element "json-value-key-flag", to: :json_value_key_flag
42
+ map_element "group-as", to: :group_as
43
+ map_element "flag", to: :flag
44
+ map_element "define-flag", to: :define_flag
45
+ map_element "model", to: :model
46
+ map_element "constraint", to: :constraint
47
+ map_element "remarks", to: :remarks
48
+ map_element "example", to: :example
62
49
  end
63
50
  end
64
51
  end
@@ -1,34 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- require_relative 'define_field_constraints_type'
6
- require_relative 'example_type'
7
- require_relative 'flag_reference_type'
8
- require_relative 'group_as_type'
9
- require_relative 'inline_flag_definition_type'
10
- require_relative 'json_key_type'
11
- require_relative 'json_value_key_flag_type'
12
- require_relative 'markup_line_datatype'
13
- require_relative 'property_type'
14
- require_relative 'remarks_type'
15
-
16
3
  module Metaschema
17
4
  class InlineFieldDefinitionType < Lutaml::Model::Serializable
18
- attribute :as_type, :string, default: -> { 'string' }
5
+ attribute :as_type, :string, default: -> { "string" }
19
6
  attribute :default, :string
20
- attribute :collapsible, :string, default: -> { 'no' }
21
- attribute :min_occurs, :integer, default: -> { '0' }
22
- attribute :max_occurs, :string, default: -> { '1' }
7
+ attribute :collapsible, :string, default: -> { "no" }
8
+ attribute :min_occurs, :integer, default: -> { "0" }
9
+ attribute :max_occurs, :string, default: -> { "1" }
23
10
  attribute :name, :string
24
11
  attribute :index, :integer
25
- attribute :in_xml, :string, default: -> { 'WRAPPED' }
12
+ attribute :in_xml, :string, default: -> { "WRAPPED" }
26
13
  attribute :deprecated, :string
27
- attribute :formal_name, :string
14
+ attribute :formal_name, FormalName
28
15
  attribute :description, MarkupLineDatatype
29
16
  attribute :prop, PropertyType, collection: true
30
17
  attribute :json_key, JsonKeyType
31
- attribute :json_value_key, :string
18
+ attribute :json_value_key, JsonValueKey
19
+
32
20
  attribute :json_value_key_flag, JsonValueKeyFlagType
33
21
  attribute :group_as, GroupAsType
34
22
  attribute :flag, FlagReferenceType, collection: true
@@ -38,30 +26,30 @@ module Metaschema
38
26
  attribute :example, ExampleType, collection: true
39
27
 
40
28
  xml do
41
- root 'InlineFieldDefinitionType'
42
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
29
+ element "InlineFieldDefinitionType"
30
+ namespace ::Metaschema::Namespace
43
31
 
44
- map_attribute 'as-type', to: :as_type
45
- map_attribute 'default', to: :default
46
- map_attribute 'collapsible', to: :collapsible
47
- map_attribute 'min-occurs', to: :min_occurs
48
- map_attribute 'max-occurs', to: :max_occurs
49
- map_attribute 'name', to: :name
50
- map_attribute 'index', to: :index
51
- map_attribute 'in-xml', to: :in_xml
52
- map_attribute 'deprecated', to: :deprecated
53
- map_element 'formal-name', to: :formal_name
54
- map_element 'description', to: :description
55
- map_element 'prop', to: :prop
56
- map_element 'json-key', to: :json_key
57
- map_element 'json-value-key', to: :json_value_key
58
- map_element 'json-value-key-flag', to: :json_value_key_flag
59
- map_element 'group-as', to: :group_as
60
- map_element 'flag', to: :flag
61
- map_element 'define-flag', to: :define_flag
62
- map_element 'constraint', to: :constraint
63
- map_element 'remarks', to: :remarks
64
- map_element 'example', to: :example
32
+ map_attribute "as-type", to: :as_type
33
+ map_attribute "default", to: :default
34
+ map_attribute "collapsible", to: :collapsible
35
+ map_attribute "min-occurs", to: :min_occurs
36
+ map_attribute "max-occurs", to: :max_occurs
37
+ map_attribute "name", to: :name
38
+ map_attribute "index", to: :index
39
+ map_attribute "in-xml", to: :in_xml
40
+ map_attribute "deprecated", to: :deprecated
41
+ map_element "formal-name", to: :formal_name
42
+ map_element "description", to: :description
43
+ map_element "prop", to: :prop
44
+ map_element "json-key", to: :json_key
45
+ map_element "json-value-key", to: :json_value_key
46
+ map_element "json-value-key-flag", to: :json_value_key_flag
47
+ map_element "group-as", to: :group_as
48
+ map_element "flag", to: :flag
49
+ map_element "define-flag", to: :define_flag
50
+ map_element "constraint", to: :constraint
51
+ map_element "remarks", to: :remarks
52
+ map_element "example", to: :example
65
53
  end
66
54
  end
67
55
  end
@@ -1,22 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- require_relative 'define_flag_constraints_type'
6
- require_relative 'example_type'
7
- require_relative 'markup_line_datatype'
8
- require_relative 'property_type'
9
- require_relative 'remarks_type'
10
-
11
3
  module Metaschema
12
4
  class InlineFlagDefinitionType < Lutaml::Model::Serializable
13
5
  attribute :name, :string
14
6
  attribute :index, :integer
15
- attribute :as_type, :string, default: -> { 'string' }
7
+ attribute :as_type, :string, default: -> { "string" }
16
8
  attribute :default, :string
17
- attribute :required, :string, default: -> { 'no' }
9
+ attribute :required, :string, default: -> { "no" }
18
10
  attribute :deprecated, :string
19
- attribute :formal_name, :string
11
+ attribute :formal_name, FormalName
20
12
  attribute :description, MarkupLineDatatype
21
13
  attribute :prop, PropertyType, collection: true
22
14
  attribute :constraint, DefineFlagConstraintsType
@@ -24,21 +16,21 @@ module Metaschema
24
16
  attribute :example, ExampleType, collection: true
25
17
 
26
18
  xml do
27
- root 'InlineFlagDefinitionType'
28
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
19
+ element "InlineFlagDefinitionType"
20
+ namespace ::Metaschema::Namespace
29
21
 
30
- map_attribute 'name', to: :name
31
- map_attribute 'index', to: :index
32
- map_attribute 'as-type', to: :as_type
33
- map_attribute 'default', to: :default
34
- map_attribute 'required', to: :required
35
- map_attribute 'deprecated', to: :deprecated
36
- map_element 'formal-name', to: :formal_name
37
- map_element 'description', to: :description
38
- map_element 'prop', to: :prop
39
- map_element 'constraint', to: :constraint
40
- map_element 'remarks', to: :remarks
41
- map_element 'example', to: :example
22
+ map_attribute "name", to: :name
23
+ map_attribute "index", to: :index
24
+ map_attribute "as-type", to: :as_type
25
+ map_attribute "default", to: :default
26
+ map_attribute "required", to: :required
27
+ map_attribute "deprecated", to: :deprecated
28
+ map_element "formal-name", to: :formal_name
29
+ map_element "description", to: :description
30
+ map_element "prop", to: :prop
31
+ map_element "constraint", to: :constraint
32
+ map_element "remarks", to: :remarks
33
+ map_element "example", to: :example
42
34
  end
43
35
  end
44
36
  end
@@ -1,12 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- # require_relative "anchor_type"
6
- # require_relative "code_type"
7
- require_relative 'image_type'
8
- require_relative 'insert_type'
9
-
3
+ # #
10
4
  module Metaschema
11
5
  class AnchorType < Lutaml::Model::Serializable
12
6
  end
@@ -30,22 +24,23 @@ module Metaschema
30
24
  attribute :img, ImageType, collection: true
31
25
 
32
26
  xml do
33
- root 'inlineMarkupType', mixed: true
34
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
27
+ element "inlineMarkupType"
28
+ mixed_content
29
+ namespace ::Metaschema::Namespace
35
30
 
36
31
  map_content to: :content
37
- map_element 'a', to: :a
38
- map_element 'insert', to: :insert
39
- map_element 'br', to: :br
40
- map_element 'code', to: :code
41
- map_element 'em', to: :em
42
- map_element 'i', to: :i
43
- map_element 'b', to: :b
44
- map_element 'strong', to: :strong
45
- map_element 'sub', to: :sub
46
- map_element 'sup', to: :sup
47
- map_element 'q', to: :q
48
- map_element 'img', to: :img
32
+ map_element "a", to: :a
33
+ map_element "insert", to: :insert
34
+ map_element "br", to: :br
35
+ map_element "code", to: :code
36
+ map_element "em", to: :em
37
+ map_element "i", to: :i
38
+ map_element "b", to: :b
39
+ map_element "strong", to: :strong
40
+ map_element "sub", to: :sub
41
+ map_element "sup", to: :sup
42
+ map_element "q", to: :q
43
+ map_element "img", to: :img
49
44
  end
50
45
  end
51
46
  end
@@ -1,18 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
3
  module Metaschema
6
4
  class InsertType < Lutaml::Model::Serializable
7
5
  attribute :type, :string
8
6
  attribute :id_ref, :string
9
7
 
10
8
  xml do
11
- root 'insertType'
12
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
9
+ element "insertType"
10
+ namespace ::Metaschema::Namespace
13
11
 
14
- map_attribute 'type', to: :type
15
- map_attribute 'id-ref', to: :id_ref
12
+ map_attribute "type", to: :type
13
+ map_attribute "id-ref", to: :id_ref
16
14
  end
17
15
  end
18
16
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metaschema
4
+ class JsonBaseUri < Lutaml::Model::Type::String
5
+ xml do
6
+ namespace ::Metaschema::Namespace
7
+ end
8
+ end
9
+ end
@@ -1,16 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
3
  module Metaschema
6
4
  class JsonKeyType < Lutaml::Model::Serializable
7
5
  attribute :flag_ref, :string
8
6
 
9
7
  xml do
10
- root 'JsonKeyType'
11
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
8
+ element "JsonKeyType"
9
+ namespace ::Metaschema::Namespace
12
10
 
13
- map_attribute 'flag-ref', to: :flag_ref
11
+ map_attribute "flag-ref", to: :flag_ref
14
12
  end
15
13
  end
16
14
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metaschema
4
+ class JsonValueKey < Lutaml::Model::Type::String
5
+ xml do
6
+ namespace ::Metaschema::Namespace
7
+ end
8
+ end
9
+ end
@@ -1,16 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
3
  module Metaschema
6
4
  class JsonValueKeyFlagType < Lutaml::Model::Serializable
7
5
  attribute :flag_ref, :string
8
6
 
9
7
  xml do
10
- root 'JsonValueKeyFlagType'
11
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
8
+ element "JsonValueKeyFlagType"
9
+ namespace ::Metaschema::Namespace
12
10
 
13
- map_attribute 'flag-ref', to: :flag_ref
11
+ map_attribute "flag-ref", to: :flag_ref
14
12
  end
15
13
  end
16
14
  end
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- require_relative 'remarks_type'
6
-
7
3
  module Metaschema
8
4
  class KeyField < Lutaml::Model::Serializable
9
5
  attribute :target, :string
@@ -11,12 +7,12 @@ module Metaschema
11
7
  attribute :remarks, RemarksType
12
8
 
13
9
  xml do
14
- root 'key-field'
15
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
10
+ element "key-field"
11
+ namespace ::Metaschema::Namespace
16
12
 
17
- map_attribute 'target', to: :target
18
- map_attribute 'pattern', to: :pattern
19
- map_element 'remarks', to: :remarks
13
+ map_attribute "target", to: :target
14
+ map_attribute "pattern", to: :pattern
15
+ map_element "remarks", to: :remarks
20
16
  end
21
17
  end
22
18
  end
@@ -1,17 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- require_relative 'anchor_type'
6
- # require_relative "block_quote_type"
7
- require_relative 'code_type'
8
- require_relative 'image_type'
9
- require_relative 'inline_markup_type'
10
- require_relative 'insert_type'
11
- # require_relative "list_type"
12
- require_relative 'ordered_list_type'
13
- require_relative 'preformatted_type'
14
-
3
+ # #
15
4
  module Metaschema
16
5
  class ListType < Lutaml::Model::Serializable; end
17
6
  class BlockQuoteType < Lutaml::Model::Serializable; end
@@ -44,34 +33,35 @@ module Metaschema
44
33
  attribute :p, InlineMarkupType, collection: true
45
34
 
46
35
  xml do
47
- root 'listItemType', mixed: true
48
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
36
+ element "listItemType"
37
+ mixed_content
38
+ namespace ::Metaschema::Namespace
49
39
 
50
40
  map_content to: :content
51
- map_element 'a', to: :a
52
- map_element 'insert', to: :insert
53
- map_element 'br', to: :br
54
- map_element 'code', to: :code
55
- map_element 'em', to: :em
56
- map_element 'i', to: :i
57
- map_element 'b', to: :b
58
- map_element 'strong', to: :strong
59
- map_element 'sub', to: :sub
60
- map_element 'sup', to: :sup
61
- map_element 'q', to: :q
62
- map_element 'img', to: :img
63
- map_element 'ul', to: :ul
64
- map_element 'ol', to: :ol
65
- map_element 'pre', to: :pre
66
- map_element 'hr', to: :hr
67
- map_element 'blockquote', to: :blockquote
68
- map_element 'h1', to: :h1
69
- map_element 'h2', to: :h2
70
- map_element 'h3', to: :h3
71
- map_element 'h4', to: :h4
72
- map_element 'h5', to: :h5
73
- map_element 'h6', to: :h6
74
- map_element 'p', to: :p
41
+ map_element "a", to: :a
42
+ map_element "insert", to: :insert
43
+ map_element "br", to: :br
44
+ map_element "code", to: :code
45
+ map_element "em", to: :em
46
+ map_element "i", to: :i
47
+ map_element "b", to: :b
48
+ map_element "strong", to: :strong
49
+ map_element "sub", to: :sub
50
+ map_element "sup", to: :sup
51
+ map_element "q", to: :q
52
+ map_element "img", to: :img
53
+ map_element "ul", to: :ul
54
+ map_element "ol", to: :ol
55
+ map_element "pre", to: :pre
56
+ map_element "hr", to: :hr
57
+ map_element "blockquote", to: :blockquote
58
+ map_element "h1", to: :h1
59
+ map_element "h2", to: :h2
60
+ map_element "h3", to: :h3
61
+ map_element "h4", to: :h4
62
+ map_element "h5", to: :h5
63
+ map_element "h6", to: :h6
64
+ map_element "p", to: :p
75
65
  end
76
66
  end
77
67
  end
@@ -1,18 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- require_relative 'list_item_type'
6
-
7
3
  module Metaschema
8
4
  class ListType < Lutaml::Model::Serializable
9
5
  attribute :li, ListItemType, collection: true
10
6
 
11
7
  xml do
12
- root 'listType'
13
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
8
+ element "listType"
9
+ namespace ::Metaschema::Namespace
14
10
 
15
- map_element 'li', to: :li
11
+ map_element "li", to: :li
16
12
  end
17
13
  end
18
14
  end
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
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'
10
-
11
3
  module Metaschema
12
4
  class MarkupLineDatatype < Lutaml::Model::Serializable
13
5
  attribute :content, :string
@@ -25,22 +17,23 @@ module Metaschema
25
17
  attribute :img, ImageType, collection: true
26
18
 
27
19
  xml do
28
- root 'MarkupLineDatatype', mixed: true
29
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
20
+ element "MarkupLineDatatype"
21
+ namespace ::Metaschema::Namespace
22
+ mixed_content
30
23
 
31
24
  map_content to: :content
32
- map_element 'a', to: :a
33
- map_element 'insert', to: :insert
34
- map_element 'br', to: :br
35
- map_element 'code', to: :code
36
- map_element 'em', to: :em
37
- map_element 'i', to: :i
38
- map_element 'b', to: :b
39
- map_element 'strong', to: :strong
40
- map_element 'sub', to: :sub
41
- map_element 'sup', to: :sup
42
- map_element 'q', to: :q
43
- map_element 'img', to: :img
25
+ map_element "a", to: :a
26
+ map_element "insert", to: :insert
27
+ map_element "br", to: :br
28
+ map_element "code", to: :code
29
+ map_element "em", to: :em
30
+ map_element "i", to: :i
31
+ map_element "b", to: :b
32
+ map_element "strong", to: :strong
33
+ map_element "sub", to: :sub
34
+ map_element "sup", to: :sup
35
+ map_element "q", to: :q
36
+ map_element "img", to: :img
44
37
  end
45
38
  end
46
39
  end
@@ -1,34 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'lutaml/model'
4
-
5
- require_relative 'markup_line_datatype'
6
- require_relative 'property_type'
7
- require_relative 'remarks_type'
8
-
9
3
  module Metaschema
10
4
  class MatchesConstraintType < Lutaml::Model::Serializable
11
5
  attribute :id, :string
12
- attribute :level, :string, default: -> { 'ERROR' }
6
+ attribute :level, :string, default: -> { "ERROR" }
13
7
  attribute :regex, :string
14
8
  attribute :datatype, :string
15
- attribute :formal_name, :string
9
+ attribute :formal_name, FormalName
16
10
  attribute :description, MarkupLineDatatype
17
11
  attribute :prop, PropertyType, collection: true
18
12
  attribute :remarks, RemarksType
19
13
 
20
14
  xml do
21
- root 'MatchesConstraintType'
22
- namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
15
+ element "MatchesConstraintType"
16
+ namespace ::Metaschema::Namespace
23
17
 
24
- map_attribute 'id', to: :id
25
- map_attribute 'level', to: :level
26
- map_attribute 'regex', to: :regex
27
- map_attribute 'datatype', to: :datatype
28
- map_element 'formal-name', to: :formal_name
29
- map_element 'description', to: :description
30
- map_element 'prop', to: :prop
31
- map_element 'remarks', to: :remarks
18
+ map_attribute "id", to: :id
19
+ map_attribute "level", to: :level
20
+ map_attribute "regex", to: :regex
21
+ map_attribute "datatype", to: :datatype
22
+ map_element "formal-name", to: :formal_name
23
+ map_element "description", to: :description
24
+ map_element "prop", to: :prop
25
+ map_element "remarks", to: :remarks
32
26
  end
33
27
  end
34
28
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metaschema
4
+ class MetaschemaConstraints < Lutaml::Model::Serializable
5
+ attribute :name, :string
6
+ attribute :version, :string
7
+ attribute :import, Import, collection: true
8
+ attribute :namespace_binding, NamespaceBindingType, collection: true
9
+ attribute :scope, Scope, collection: true
10
+ attribute :remarks, RemarksType
11
+
12
+ xml do
13
+ element "METASCHEMA-CONSTRAINTS"
14
+ namespace ::Metaschema::Namespace
15
+
16
+ map_element "name", to: :name
17
+ map_element "version", to: :version
18
+ map_element "import", to: :import
19
+ map_element "namespace-binding", to: :namespace_binding
20
+ map_element "scope", to: :scope
21
+ map_element "remarks", to: :remarks
22
+ end
23
+ end
24
+ end