metaschema 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +64 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +76 -0
- data/Rakefile +3 -3
- data/exe/metaschema +2 -2
- data/lib/metaschema/allowed_value_type.rb +24 -22
- data/lib/metaschema/allowed_values_type.rb +21 -19
- data/lib/metaschema/anchor_type.rb +19 -17
- data/lib/metaschema/any_type.rb +5 -3
- data/lib/metaschema/assembly.rb +24 -22
- data/lib/metaschema/assembly_model_type.rb +19 -17
- data/lib/metaschema/assembly_reference_type.rb +23 -21
- data/lib/metaschema/block_quote_type.rb +25 -23
- data/lib/metaschema/choice_type.rb +13 -11
- data/lib/metaschema/code_type.rb +23 -21
- data/lib/metaschema/constraint_let_type.rb +9 -7
- data/lib/metaschema/define_assembly_constraints_type.rb +23 -21
- data/lib/metaschema/define_field_constraints_type.rb +17 -15
- data/lib/metaschema/define_flag_constraints_type.rb +17 -15
- data/lib/metaschema/example_type.rb +11 -9
- data/lib/metaschema/expect_constraint_type.rb +17 -15
- data/lib/metaschema/field.rb +18 -16
- data/lib/metaschema/field_reference_type.rb +26 -24
- data/lib/metaschema/flag.rb +18 -16
- data/lib/metaschema/flag_reference_type.rb +20 -18
- data/lib/metaschema/global_assembly_definition_type.rb +33 -31
- data/lib/metaschema/global_field_definition_type.rb +37 -33
- data/lib/metaschema/global_flag_definition_type.rb +26 -24
- data/lib/metaschema/group_as_type.rb +10 -8
- data/lib/metaschema/grouped_assembly_reference_type.rb +17 -15
- data/lib/metaschema/grouped_choice_type.rb +23 -21
- data/lib/metaschema/grouped_field_reference_type.rb +17 -15
- data/lib/metaschema/grouped_inline_assembly_definition_type.rb +28 -26
- data/lib/metaschema/grouped_inline_field_definition_type.rb +35 -33
- data/lib/metaschema/image_type.rb +8 -6
- data/lib/metaschema/import.rb +6 -4
- data/lib/metaschema/index_has_key_constraint_type.rb +18 -16
- data/lib/metaschema/inline_assembly_definition_type.rb +35 -33
- data/lib/metaschema/inline_field_definition_type.rb +41 -39
- data/lib/metaschema/inline_flag_definition_type.rb +24 -22
- data/lib/metaschema/inline_markup_type.rb +19 -17
- data/lib/metaschema/insert_type.rb +7 -5
- data/lib/metaschema/json_key_type.rb +6 -4
- data/lib/metaschema/json_value_key_flag_type.rb +6 -4
- data/lib/metaschema/key_field.rb +9 -7
- data/lib/metaschema/list_item_type.rb +36 -34
- data/lib/metaschema/list_type.rb +7 -5
- data/lib/metaschema/markup_line_datatype.rb +22 -20
- data/lib/metaschema/matches_constraint_type.rb +17 -15
- data/lib/metaschema/metaschema_import_type.rb +6 -4
- data/lib/metaschema/metaschemaconstraints.rb +15 -13
- data/lib/metaschema/namespace_binding_type.rb +7 -5
- data/lib/metaschema/ordered_list_type.rb +7 -5
- data/lib/metaschema/preformatted_type.rb +22 -20
- data/lib/metaschema/property_type.rb +9 -7
- data/lib/metaschema/remarks_type.rb +28 -26
- data/lib/metaschema/root.rb +27 -25
- data/lib/metaschema/root_name.rb +6 -4
- data/lib/metaschema/scope.rb +13 -11
- data/lib/metaschema/table_cell_type.rb +24 -22
- data/lib/metaschema/table_row_type.rb +8 -6
- data/lib/metaschema/table_type.rb +7 -5
- data/lib/metaschema/targeted_allowed_values_constraint_type.rb +22 -20
- data/lib/metaschema/targeted_expect_constraint_type.rb +18 -16
- data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +18 -16
- data/lib/metaschema/targeted_index_constraint_type.rb +19 -17
- data/lib/metaschema/targeted_index_has_key_constraint_type.rb +19 -17
- data/lib/metaschema/targeted_key_constraint_type.rb +18 -16
- data/lib/metaschema/targeted_matches_constraint_type.rb +18 -16
- data/lib/metaschema/use_name_type.rb +6 -4
- data/lib/metaschema/version.rb +1 -1
- data/lib/metaschema.rb +4 -4
- metadata +9 -6
@@ -1,9 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'import'
|
6
|
+
require_relative 'namespace_binding_type'
|
7
|
+
require_relative 'remarks_type'
|
8
|
+
require_relative 'scope'
|
7
9
|
|
8
10
|
module Metaschema
|
9
11
|
class METASCHEMACONSTRAINTS < Lutaml::Model::Serializable
|
@@ -15,15 +17,15 @@ module Metaschema
|
|
15
17
|
attribute :remarks, RemarksType
|
16
18
|
|
17
19
|
xml do
|
18
|
-
root
|
19
|
-
namespace
|
20
|
+
root 'METASCHEMA-CONSTRAINTS'
|
21
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
20
22
|
|
21
|
-
map_element
|
22
|
-
map_element
|
23
|
-
map_element
|
24
|
-
map_element
|
25
|
-
map_element
|
26
|
-
map_element
|
23
|
+
map_element 'name', to: :name
|
24
|
+
map_element 'version', to: :version
|
25
|
+
map_element 'import', to: :import
|
26
|
+
map_element 'namespace-binding', to: :namespace_binding
|
27
|
+
map_element 'scope', to: :scope
|
28
|
+
map_element 'remarks', to: :remarks
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lutaml/model'
|
2
4
|
|
3
5
|
module Metaschema
|
4
6
|
class NamespaceBindingType < Lutaml::Model::Serializable
|
@@ -6,11 +8,11 @@ module Metaschema
|
|
6
8
|
attribute :uri, :string
|
7
9
|
|
8
10
|
xml do
|
9
|
-
root
|
10
|
-
namespace
|
11
|
+
root 'NamespaceBindingType'
|
12
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
11
13
|
|
12
|
-
map_attribute
|
13
|
-
map_attribute
|
14
|
+
map_attribute 'prefix', to: :prefix
|
15
|
+
map_attribute 'uri', to: :uri
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lutaml/model'
|
2
4
|
|
3
5
|
# require_relative "list_item_type"
|
4
6
|
|
@@ -10,11 +12,11 @@ module Metaschema
|
|
10
12
|
attribute :li, ListItemType, collection: true
|
11
13
|
|
12
14
|
xml do
|
13
|
-
root
|
14
|
-
namespace
|
15
|
+
root 'orderedListType'
|
16
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
15
17
|
|
16
|
-
map_attribute
|
17
|
-
map_element
|
18
|
+
map_attribute 'start', to: :start
|
19
|
+
map_element 'li', to: :li
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
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 PreformattedType < Lutaml::Model::Serializable
|
@@ -23,22 +25,22 @@ module Metaschema
|
|
23
25
|
attribute :img, ImageType, collection: true
|
24
26
|
|
25
27
|
xml do
|
26
|
-
root
|
27
|
-
namespace
|
28
|
+
root 'preformattedType', mixed: true
|
29
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
28
30
|
|
29
31
|
map_content to: :content
|
30
|
-
map_element
|
31
|
-
map_element
|
32
|
-
map_element
|
33
|
-
map_element
|
34
|
-
map_element
|
35
|
-
map_element
|
36
|
-
map_element
|
37
|
-
map_element
|
38
|
-
map_element
|
39
|
-
map_element
|
40
|
-
map_element
|
41
|
-
map_element
|
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
|
42
44
|
end
|
43
45
|
end
|
44
46
|
end
|
@@ -1,18 +1,20 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lutaml/model'
|
2
4
|
|
3
5
|
module Metaschema
|
4
6
|
class PropertyType < Lutaml::Model::Serializable
|
5
|
-
attribute :namespace, :string, default: -> {
|
7
|
+
attribute :namespace, :string, default: -> { 'http://csrc.nist.gov/ns/oscal/metaschema/1.0' }
|
6
8
|
attribute :name, :string
|
7
9
|
attribute :value, :string
|
8
10
|
|
9
11
|
xml do
|
10
|
-
root
|
11
|
-
namespace
|
12
|
+
root 'PropertyType'
|
13
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
12
14
|
|
13
|
-
map_attribute
|
14
|
-
map_attribute
|
15
|
-
map_attribute
|
15
|
+
map_attribute 'namespace', to: :namespace
|
16
|
+
map_attribute 'name', to: :name
|
17
|
+
map_attribute 'value', to: :value
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'block_quote_type'
|
6
|
+
require_relative 'image_type'
|
7
|
+
require_relative 'inline_markup_type'
|
8
|
+
require_relative 'list_type'
|
9
|
+
require_relative 'ordered_list_type'
|
10
|
+
require_relative 'preformatted_type'
|
11
|
+
require_relative 'table_type'
|
10
12
|
|
11
13
|
module Metaschema
|
12
14
|
class RemarksType < Lutaml::Model::Serializable
|
13
|
-
attribute :
|
15
|
+
attribute :klass, :string
|
14
16
|
attribute :h1, InlineMarkupType, collection: true
|
15
17
|
attribute :h2, InlineMarkupType, collection: true
|
16
18
|
attribute :h3, InlineMarkupType, collection: true
|
@@ -27,24 +29,24 @@ module Metaschema
|
|
27
29
|
attribute :img, ImageType, collection: true
|
28
30
|
|
29
31
|
xml do
|
30
|
-
root
|
31
|
-
namespace
|
32
|
+
root 'RemarksType', mixed: true
|
33
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
32
34
|
|
33
|
-
map_attribute
|
34
|
-
map_element
|
35
|
-
map_element
|
36
|
-
map_element
|
37
|
-
map_element
|
38
|
-
map_element
|
39
|
-
map_element
|
40
|
-
map_element
|
41
|
-
map_element
|
42
|
-
map_element
|
43
|
-
map_element
|
44
|
-
map_element
|
45
|
-
map_element
|
46
|
-
map_element
|
47
|
-
map_element
|
35
|
+
map_attribute 'class', to: :klass
|
36
|
+
map_element 'h1', to: :h1
|
37
|
+
map_element 'h2', to: :h2
|
38
|
+
map_element 'h3', to: :h3
|
39
|
+
map_element 'h4', to: :h4
|
40
|
+
map_element 'h5', to: :h5
|
41
|
+
map_element 'h6', to: :h6
|
42
|
+
map_element 'ul', to: :ul
|
43
|
+
map_element 'ol', to: :ol
|
44
|
+
map_element 'pre', to: :pre
|
45
|
+
map_element 'hr', to: :hr
|
46
|
+
map_element 'blockquote', to: :blockquote
|
47
|
+
map_element 'p', to: :p
|
48
|
+
map_element 'table', to: :table
|
49
|
+
map_element 'img', to: :img
|
48
50
|
end
|
49
51
|
end
|
50
52
|
end
|
data/lib/metaschema/root.rb
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
10
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'global_assembly_definition_type'
|
6
|
+
require_relative 'global_field_definition_type'
|
7
|
+
require_relative 'global_flag_definition_type'
|
8
|
+
require_relative 'markup_line_datatype'
|
9
|
+
require_relative 'metaschema_import_type'
|
10
|
+
require_relative 'namespace_binding_type'
|
11
|
+
require_relative 'property_type'
|
12
|
+
require_relative 'remarks_type'
|
11
13
|
|
12
14
|
module Metaschema
|
13
15
|
class Root < Lutaml::Model::Serializable
|
14
|
-
attribute :abstract, :string, default: -> {
|
16
|
+
attribute :abstract, :string, default: -> { 'no' }
|
15
17
|
attribute :schema_name, MarkupLineDatatype
|
16
18
|
attribute :schema_version, :string
|
17
19
|
attribute :short_name, :string
|
@@ -26,22 +28,22 @@ module Metaschema
|
|
26
28
|
attribute :define_flag, GlobalFlagDefinitionType, collection: true
|
27
29
|
|
28
30
|
xml do
|
29
|
-
root
|
30
|
-
namespace
|
31
|
+
root 'METASCHEMA', ordered: true
|
32
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
31
33
|
|
32
|
-
map_attribute
|
33
|
-
map_element
|
34
|
-
map_element
|
35
|
-
map_element
|
36
|
-
map_element
|
37
|
-
map_element
|
38
|
-
map_element
|
39
|
-
map_element
|
40
|
-
map_element
|
41
|
-
map_element
|
42
|
-
map_element
|
43
|
-
map_element
|
44
|
-
map_element
|
34
|
+
map_attribute 'abstract', to: :abstract
|
35
|
+
map_element 'schema-name', to: :schema_name
|
36
|
+
map_element 'schema-version', to: :schema_version
|
37
|
+
map_element 'short-name', to: :short_name
|
38
|
+
map_element 'namespace', to: :namespace
|
39
|
+
map_element 'json-base-uri', to: :json_base_uri
|
40
|
+
map_element 'prop', to: :prop
|
41
|
+
map_element 'remarks', to: :remarks
|
42
|
+
map_element 'import', to: :import
|
43
|
+
map_element 'namespace-binding', to: :namespace_binding
|
44
|
+
map_element 'define-assembly', to: :define_assembly
|
45
|
+
map_element 'define-field', to: :define_field
|
46
|
+
map_element 'define-flag', to: :define_flag
|
45
47
|
end
|
46
48
|
end
|
47
49
|
end
|
data/lib/metaschema/root_name.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lutaml/model'
|
2
4
|
|
3
5
|
module Metaschema
|
4
6
|
class RootName < Lutaml::Model::Serializable
|
@@ -6,11 +8,11 @@ module Metaschema
|
|
6
8
|
attribute :index, :integer
|
7
9
|
|
8
10
|
xml do
|
9
|
-
root
|
10
|
-
namespace
|
11
|
+
root 'root-name'
|
12
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
11
13
|
|
12
14
|
map_content to: :content
|
13
|
-
map_attribute
|
15
|
+
map_attribute 'index', to: :index
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
data/lib/metaschema/scope.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'assembly'
|
6
|
+
require_relative 'field'
|
7
|
+
require_relative 'flag'
|
6
8
|
|
7
9
|
module Metaschema
|
8
10
|
class Scope < Lutaml::Model::Serializable
|
@@ -13,14 +15,14 @@ module Metaschema
|
|
13
15
|
attribute :flag, Flag, collection: true
|
14
16
|
|
15
17
|
xml do
|
16
|
-
root
|
17
|
-
namespace
|
18
|
+
root 'scope'
|
19
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
18
20
|
|
19
|
-
map_attribute
|
20
|
-
map_attribute
|
21
|
-
map_element
|
22
|
-
map_element
|
23
|
-
map_element
|
21
|
+
map_attribute 'metaschema-namespace', to: :metaschema_namespace
|
22
|
+
map_attribute 'metaschema-short-name', to: :metaschema_short_name
|
23
|
+
map_element 'field', to: :field
|
24
|
+
map_element 'assembly', to: :assembly
|
25
|
+
map_element 'flag', to: :flag
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
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 TableCellType < Lutaml::Model::Serializable
|
11
13
|
attribute :content, :string
|
12
|
-
attribute :align, :string, default: -> {
|
14
|
+
attribute :align, :string, default: -> { 'left' }
|
13
15
|
attribute :a, AnchorType, collection: true
|
14
16
|
attribute :insert, InsertType, collection: true
|
15
17
|
attribute :br, :string, collection: true
|
@@ -24,23 +26,23 @@ module Metaschema
|
|
24
26
|
attribute :img, ImageType, collection: true
|
25
27
|
|
26
28
|
xml do
|
27
|
-
root
|
28
|
-
namespace
|
29
|
+
root 'tableCellType', mixed: true
|
30
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
29
31
|
|
30
32
|
map_content to: :content
|
31
|
-
map_attribute
|
32
|
-
map_element
|
33
|
-
map_element
|
34
|
-
map_element
|
35
|
-
map_element
|
36
|
-
map_element
|
37
|
-
map_element
|
38
|
-
map_element
|
39
|
-
map_element
|
40
|
-
map_element
|
41
|
-
map_element
|
42
|
-
map_element
|
43
|
-
map_element
|
33
|
+
map_attribute 'align', to: :align
|
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
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'table_cell_type'
|
4
6
|
|
5
7
|
module Metaschema
|
6
8
|
class TableRowType < Lutaml::Model::Serializable
|
@@ -8,11 +10,11 @@ module Metaschema
|
|
8
10
|
attribute :th, TableCellType, collection: true
|
9
11
|
|
10
12
|
xml do
|
11
|
-
root
|
12
|
-
namespace
|
13
|
+
root 'tableRowType'
|
14
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
13
15
|
|
14
|
-
map_element
|
15
|
-
map_element
|
16
|
+
map_element 'td', to: :td
|
17
|
+
map_element 'th', to: :th
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'table_row_type'
|
4
6
|
|
5
7
|
module Metaschema
|
6
8
|
class TableType < Lutaml::Model::Serializable
|
7
9
|
attribute :tr, TableRowType, collection: true
|
8
10
|
|
9
11
|
xml do
|
10
|
-
root
|
11
|
-
namespace
|
12
|
+
root 'tableType'
|
13
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
12
14
|
|
13
|
-
map_element
|
15
|
+
map_element 'tr', to: :tr
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
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 TargetedAllowedValuesConstraintType < Lutaml::Model::Serializable
|
10
12
|
attribute :id, :string
|
11
|
-
attribute :level, :string, default: -> {
|
12
|
-
attribute :allow_other, :string, default: -> {
|
13
|
-
attribute :extensible, :string, default: -> {
|
13
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
14
|
+
attribute :allow_other, :string, default: -> { 'no' }
|
15
|
+
attribute :extensible, :string, default: -> { 'external' }
|
14
16
|
attribute :target, :string
|
15
17
|
attribute :formal_name, :string
|
16
18
|
attribute :description, MarkupLineDatatype
|
@@ -19,19 +21,19 @@ module Metaschema
|
|
19
21
|
attribute :remarks, RemarksType
|
20
22
|
|
21
23
|
xml do
|
22
|
-
root
|
23
|
-
namespace
|
24
|
+
root 'TargetedAllowedValuesConstraintType'
|
25
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
24
26
|
|
25
|
-
map_attribute
|
26
|
-
map_attribute
|
27
|
-
map_attribute
|
28
|
-
map_attribute
|
29
|
-
map_attribute
|
30
|
-
map_element
|
31
|
-
map_element
|
32
|
-
map_element
|
33
|
-
map_element
|
34
|
-
map_element
|
27
|
+
map_attribute 'id', to: :id
|
28
|
+
map_attribute 'level', to: :level
|
29
|
+
map_attribute 'allow-other', to: :allow_other
|
30
|
+
map_attribute 'extensible', to: :extensible
|
31
|
+
map_attribute 'target', to: :target
|
32
|
+
map_element 'formal-name', to: :formal_name
|
33
|
+
map_element 'description', to: :description
|
34
|
+
map_element 'prop', to: :prop
|
35
|
+
map_element 'enum', to: :enum
|
36
|
+
map_element 'remarks', to: :remarks
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'markup_line_datatype'
|
6
|
+
require_relative 'property_type'
|
7
|
+
require_relative 'remarks_type'
|
6
8
|
|
7
9
|
module Metaschema
|
8
10
|
class TargetedExpectConstraintType < Lutaml::Model::Serializable
|
9
11
|
attribute :id, :string
|
10
|
-
attribute :level, :string, default: -> {
|
12
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
11
13
|
attribute :test, :string
|
12
14
|
attribute :target, :string
|
13
15
|
attribute :formal_name, :string
|
@@ -17,18 +19,18 @@ module Metaschema
|
|
17
19
|
attribute :remarks, RemarksType
|
18
20
|
|
19
21
|
xml do
|
20
|
-
root
|
21
|
-
namespace
|
22
|
+
root 'TargetedExpectConstraintType'
|
23
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
22
24
|
|
23
|
-
map_attribute
|
24
|
-
map_attribute
|
25
|
-
map_attribute
|
26
|
-
map_attribute
|
27
|
-
map_element
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
31
|
-
map_element
|
25
|
+
map_attribute 'id', to: :id
|
26
|
+
map_attribute 'level', to: :level
|
27
|
+
map_attribute 'test', to: :test
|
28
|
+
map_attribute 'target', to: :target
|
29
|
+
map_element 'formal-name', to: :formal_name
|
30
|
+
map_element 'description', to: :description
|
31
|
+
map_element 'prop', to: :prop
|
32
|
+
map_element 'message', to: :message
|
33
|
+
map_element 'remarks', to: :remarks
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|