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