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,23 +1,26 @@
|
|
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
|
11
|
-
require_relative
|
12
|
-
require_relative
|
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 '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
|
+
require_relative 'use_name_type'
|
13
15
|
|
14
16
|
module Metaschema
|
15
17
|
class GlobalFieldDefinitionType < Lutaml::Model::Serializable
|
16
|
-
attribute :as_type, :string, default: -> {
|
18
|
+
attribute :as_type, :string, default: -> { 'string' }
|
17
19
|
attribute :default, :string
|
18
20
|
attribute :name, :string
|
19
21
|
attribute :index, :integer
|
20
|
-
attribute :scope, :string, default: -> {
|
22
|
+
attribute :scope, :string, default: -> { 'global' }
|
23
|
+
attribute :collapsible, :string, default: -> { 'no' }
|
21
24
|
attribute :deprecated, :string
|
22
25
|
attribute :formal_name, :string
|
23
26
|
attribute :description, MarkupLineDatatype
|
@@ -33,27 +36,28 @@ module Metaschema
|
|
33
36
|
attribute :example, ExampleType, collection: true
|
34
37
|
|
35
38
|
xml do
|
36
|
-
root
|
37
|
-
namespace
|
39
|
+
root 'GlobalFieldDefinitionType'
|
40
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
38
41
|
|
39
|
-
map_attribute
|
40
|
-
map_attribute
|
41
|
-
map_attribute
|
42
|
-
map_attribute
|
43
|
-
map_attribute
|
44
|
-
map_attribute
|
45
|
-
|
46
|
-
map_element
|
47
|
-
map_element
|
48
|
-
map_element
|
49
|
-
map_element
|
50
|
-
map_element
|
51
|
-
map_element
|
52
|
-
map_element
|
53
|
-
map_element
|
54
|
-
map_element
|
55
|
-
map_element
|
56
|
-
map_element
|
42
|
+
map_attribute 'as-type', to: :as_type
|
43
|
+
map_attribute 'default', to: :default
|
44
|
+
map_attribute 'name', to: :name
|
45
|
+
map_attribute 'index', to: :index
|
46
|
+
map_attribute 'scope', to: :scope
|
47
|
+
map_attribute 'deprecated', to: :deprecated
|
48
|
+
map_attribute 'collapsible', to: :collapsible
|
49
|
+
map_element 'formal-name', to: :formal_name
|
50
|
+
map_element 'description', to: :description
|
51
|
+
map_element 'prop', to: :prop
|
52
|
+
map_element 'use-name', to: :use_name
|
53
|
+
map_element 'json-key', to: :json_key
|
54
|
+
map_element 'json-value-key', to: :json_value_key
|
55
|
+
map_element 'json-value-key-flag', to: :json_value_key_flag
|
56
|
+
map_element 'flag', to: :flag
|
57
|
+
map_element 'define-flag', to: :define_flag
|
58
|
+
map_element 'constraint', to: :constraint
|
59
|
+
map_element 'remarks', to: :remarks
|
60
|
+
map_element 'example', to: :example
|
57
61
|
end
|
58
62
|
end
|
59
63
|
end
|
@@ -1,19 +1,21 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
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
|
+
require_relative 'use_name_type'
|
9
11
|
|
10
12
|
module Metaschema
|
11
13
|
class GlobalFlagDefinitionType < Lutaml::Model::Serializable
|
12
14
|
attribute :name, :string
|
13
15
|
attribute :index, :integer
|
14
|
-
attribute :as_type, :string, default: -> {
|
16
|
+
attribute :as_type, :string, default: -> { 'string' }
|
15
17
|
attribute :default, :string
|
16
|
-
attribute :scope, :string, default: -> {
|
18
|
+
attribute :scope, :string, default: -> { 'global' }
|
17
19
|
attribute :deprecated, :string
|
18
20
|
attribute :formal_name, :string
|
19
21
|
attribute :description, MarkupLineDatatype
|
@@ -24,22 +26,22 @@ module Metaschema
|
|
24
26
|
attribute :example, ExampleType, collection: true
|
25
27
|
|
26
28
|
xml do
|
27
|
-
root
|
28
|
-
namespace
|
29
|
+
root 'GlobalFlagDefinitionType'
|
30
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
29
31
|
|
30
|
-
map_attribute
|
31
|
-
map_attribute
|
32
|
-
map_attribute
|
33
|
-
map_attribute
|
34
|
-
map_attribute
|
35
|
-
map_attribute
|
36
|
-
map_element
|
37
|
-
map_element
|
38
|
-
map_element
|
39
|
-
map_element
|
40
|
-
map_element
|
41
|
-
map_element
|
42
|
-
map_element
|
32
|
+
map_attribute 'name', to: :name
|
33
|
+
map_attribute 'index', to: :index
|
34
|
+
map_attribute 'as-type', to: :as_type
|
35
|
+
map_attribute 'default', to: :default
|
36
|
+
map_attribute 'scope', to: :scope
|
37
|
+
map_attribute 'deprecated', to: :deprecated
|
38
|
+
map_element 'formal-name', to: :formal_name
|
39
|
+
map_element 'description', to: :description
|
40
|
+
map_element 'prop', to: :prop
|
41
|
+
map_element 'use-name', to: :use_name
|
42
|
+
map_element 'constraint', to: :constraint
|
43
|
+
map_element 'remarks', to: :remarks
|
44
|
+
map_element 'example', to: :example
|
43
45
|
end
|
44
46
|
end
|
45
47
|
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 GroupAsType < Lutaml::Model::Serializable
|
5
7
|
attribute :name, :string
|
6
|
-
attribute :in_json, :string, default: -> {
|
7
|
-
attribute :in_xml, :string, default: -> {
|
8
|
+
attribute :in_json, :string, default: -> { 'SINGLETON_OR_ARRAY' }
|
9
|
+
attribute :in_xml, :string, default: -> { 'UNGROUPED' }
|
8
10
|
|
9
11
|
xml do
|
10
|
-
root
|
11
|
-
namespace
|
12
|
+
root 'GroupAsType'
|
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 'name', to: :name
|
16
|
+
map_attribute 'in-json', to: :in_json
|
17
|
+
map_attribute 'in-xml', to: :in_xml
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -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 'markup_line_datatype'
|
6
|
+
require_relative 'property_type'
|
7
|
+
require_relative 'remarks_type'
|
8
|
+
require_relative 'use_name_type'
|
7
9
|
|
8
10
|
module Metaschema
|
9
11
|
class GroupedAssemblyReferenceType < Lutaml::Model::Serializable
|
@@ -17,17 +19,17 @@ module Metaschema
|
|
17
19
|
attribute :remarks, RemarksType
|
18
20
|
|
19
21
|
xml do
|
20
|
-
root
|
21
|
-
namespace
|
22
|
+
root 'GroupedAssemblyReferenceType'
|
23
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
22
24
|
|
23
|
-
map_attribute
|
24
|
-
map_attribute
|
25
|
-
map_element
|
26
|
-
map_element
|
27
|
-
map_element
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
25
|
+
map_attribute 'ref', to: :ref
|
26
|
+
map_attribute 'deprecated', to: :deprecated
|
27
|
+
map_element 'formal-name', to: :formal_name
|
28
|
+
map_element 'description', to: :description
|
29
|
+
map_element 'prop', to: :prop
|
30
|
+
map_element 'use-name', to: :use_name
|
31
|
+
map_element 'discriminator-value', to: :discriminator_value
|
32
|
+
map_element 'remarks', to: :remarks
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -1,37 +1,39 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'group_as_type'
|
6
|
+
require_relative 'grouped_assembly_reference_type'
|
7
|
+
require_relative 'grouped_field_reference_type'
|
8
|
+
require_relative 'grouped_inline_assembly_definition_type'
|
9
|
+
require_relative 'grouped_inline_field_definition_type'
|
10
|
+
require_relative 'json_key_type'
|
9
11
|
|
10
12
|
module Metaschema
|
11
13
|
class GroupedChoiceType < Lutaml::Model::Serializable
|
12
|
-
attribute :min_occurs, :integer, default: -> {
|
13
|
-
attribute :max_occurs, :string, default: -> {
|
14
|
+
attribute :min_occurs, :integer, default: -> { '0' }
|
15
|
+
attribute :max_occurs, :string, default: -> { 'unbounded' }
|
14
16
|
attribute :json_key, JsonKeyType
|
15
17
|
attribute :group_as, GroupAsType
|
16
|
-
attribute :discriminator, :string, default: -> {
|
18
|
+
attribute :discriminator, :string, default: -> { 'object-type' }
|
17
19
|
attribute :assembly, GroupedAssemblyReferenceType, collection: true
|
18
20
|
attribute :field, GroupedFieldReferenceType, collection: true
|
19
21
|
attribute :define_assembly, GroupedInlineAssemblyDefinitionType, collection: true
|
20
22
|
attribute :define_field, GroupedInlineFieldDefinitionType, collection: true
|
21
23
|
|
22
24
|
xml do
|
23
|
-
root
|
24
|
-
namespace
|
25
|
+
root 'GroupedChoiceType'
|
26
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
25
27
|
|
26
|
-
map_attribute
|
27
|
-
map_attribute
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
31
|
-
map_element
|
32
|
-
map_element
|
33
|
-
map_element
|
34
|
-
map_element
|
28
|
+
map_attribute 'min-occurs', to: :min_occurs
|
29
|
+
map_attribute 'max-occurs', to: :max_occurs
|
30
|
+
map_element 'json-key', to: :json_key
|
31
|
+
map_element 'group-as', to: :group_as
|
32
|
+
map_element 'discriminator', to: :discriminator
|
33
|
+
map_element 'field', to: :field
|
34
|
+
map_element 'define-assembly', to: :define_assembly
|
35
|
+
map_element 'assembly', to: :assembly
|
36
|
+
map_element 'define-field', to: :define_field
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
@@ -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 'markup_line_datatype'
|
6
|
+
require_relative 'property_type'
|
7
|
+
require_relative 'remarks_type'
|
8
|
+
require_relative 'use_name_type'
|
7
9
|
|
8
10
|
module Metaschema
|
9
11
|
class GroupedFieldReferenceType < Lutaml::Model::Serializable
|
@@ -17,17 +19,17 @@ module Metaschema
|
|
17
19
|
attribute :remarks, RemarksType
|
18
20
|
|
19
21
|
xml do
|
20
|
-
root
|
21
|
-
namespace
|
22
|
+
root 'GroupedFieldReferenceType'
|
23
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
22
24
|
|
23
|
-
map_attribute
|
24
|
-
map_attribute
|
25
|
-
map_element
|
26
|
-
map_element
|
27
|
-
map_element
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
25
|
+
map_attribute 'ref', to: :ref
|
26
|
+
map_attribute 'deprecated', to: :deprecated
|
27
|
+
map_element 'formal-name', to: :formal_name
|
28
|
+
map_element 'description', to: :description
|
29
|
+
map_element 'prop', to: :prop
|
30
|
+
map_element 'use-name', to: :use_name
|
31
|
+
map_element 'discriminator-value', to: :discriminator_value
|
32
|
+
map_element 'remarks', to: :remarks
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -1,14 +1,16 @@
|
|
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
|
11
|
-
require_relative
|
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 'inline_flag_definition_type'
|
10
|
+
require_relative 'markup_line_datatype'
|
11
|
+
require_relative 'property_type'
|
12
|
+
require_relative 'remarks_type'
|
13
|
+
require_relative 'use_name_type'
|
12
14
|
|
13
15
|
module Metaschema
|
14
16
|
class GroupedInlineAssemblyDefinitionType < Lutaml::Model::Serializable
|
@@ -28,23 +30,23 @@ module Metaschema
|
|
28
30
|
attribute :example, ExampleType, collection: true
|
29
31
|
|
30
32
|
xml do
|
31
|
-
root
|
32
|
-
namespace
|
33
|
+
root 'GroupedInlineAssemblyDefinitionType'
|
34
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
33
35
|
|
34
|
-
map_attribute
|
35
|
-
map_attribute
|
36
|
-
map_attribute
|
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
|
36
|
+
map_attribute 'name', to: :name
|
37
|
+
map_attribute 'index', to: :index
|
38
|
+
map_attribute 'deprecated', to: :deprecated
|
39
|
+
map_element 'formal-name', to: :formal_name
|
40
|
+
map_element 'description', to: :description
|
41
|
+
map_element 'prop', to: :prop
|
42
|
+
map_element 'use-name', to: :use_name
|
43
|
+
map_element 'discriminator-value', to: :discriminator_value
|
44
|
+
map_element 'flag', to: :flag
|
45
|
+
map_element 'define-flag', to: :define_flag
|
46
|
+
map_element 'model', to: :model
|
47
|
+
map_element 'constraint', to: :constraint
|
48
|
+
map_element 'remarks', to: :remarks
|
49
|
+
map_element 'example', to: :example
|
48
50
|
end
|
49
51
|
end
|
50
52
|
end
|
@@ -1,22 +1,24 @@
|
|
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
|
11
|
-
require_relative
|
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 'inline_flag_definition_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
|
+
require_relative 'use_name_type'
|
12
14
|
|
13
15
|
module Metaschema
|
14
16
|
class GroupedInlineFieldDefinitionType < Lutaml::Model::Serializable
|
15
|
-
attribute :as_type, :string, default: -> {
|
16
|
-
attribute :collapsible, :string, default: -> {
|
17
|
+
attribute :as_type, :string, default: -> { 'string' }
|
18
|
+
attribute :collapsible, :string, default: -> { 'no' }
|
17
19
|
attribute :name, :string
|
18
20
|
attribute :index, :integer
|
19
|
-
attribute :in_xml, :string, default: -> {
|
21
|
+
attribute :in_xml, :string, default: -> { 'WRAPPED' }
|
20
22
|
attribute :deprecated, :string
|
21
23
|
attribute :formal_name, :string
|
22
24
|
attribute :description, MarkupLineDatatype
|
@@ -32,27 +34,27 @@ module Metaschema
|
|
32
34
|
attribute :example, ExampleType, collection: true
|
33
35
|
|
34
36
|
xml do
|
35
|
-
root
|
36
|
-
namespace
|
37
|
+
root 'GroupedInlineFieldDefinitionType'
|
38
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
37
39
|
|
38
|
-
map_attribute
|
39
|
-
map_attribute
|
40
|
-
map_attribute
|
41
|
-
map_attribute
|
42
|
-
map_attribute
|
43
|
-
map_attribute
|
44
|
-
map_element
|
45
|
-
map_element
|
46
|
-
map_element
|
47
|
-
map_element
|
48
|
-
map_element
|
49
|
-
map_element
|
50
|
-
map_element
|
51
|
-
map_element
|
52
|
-
map_element
|
53
|
-
map_element
|
54
|
-
map_element
|
55
|
-
map_element
|
40
|
+
map_attribute 'as-type', to: :as_type
|
41
|
+
map_attribute 'collapsible', to: :collapsible
|
42
|
+
map_attribute 'name', to: :name
|
43
|
+
map_attribute 'index', to: :index
|
44
|
+
map_attribute 'in-xml', to: :in_xml
|
45
|
+
map_attribute 'deprecated', to: :deprecated
|
46
|
+
map_element 'formal-name', to: :formal_name
|
47
|
+
map_element 'description', to: :description
|
48
|
+
map_element 'prop', to: :prop
|
49
|
+
map_element 'use-name', to: :use_name
|
50
|
+
map_element 'discriminator-value', to: :discriminator_value
|
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 'flag', to: :flag
|
54
|
+
map_element 'define-flag', to: :define_flag
|
55
|
+
map_element 'constraint', to: :constraint
|
56
|
+
map_element 'remarks', to: :remarks
|
57
|
+
map_element 'example', to: :example
|
56
58
|
end
|
57
59
|
end
|
58
60
|
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 ImageType < Lutaml::Model::Serializable
|
@@ -7,12 +9,12 @@ module Metaschema
|
|
7
9
|
attribute :title, :string
|
8
10
|
|
9
11
|
xml do
|
10
|
-
root
|
11
|
-
namespace
|
12
|
+
root 'imageType'
|
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 'alt', to: :alt
|
16
|
+
map_attribute 'src', to: :src
|
17
|
+
map_attribute 'title', to: :title
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
data/lib/metaschema/import.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lutaml/model'
|
2
4
|
|
3
5
|
module Metaschema
|
4
6
|
class Import < Lutaml::Model::Serializable
|
5
7
|
attribute :href, :string
|
6
8
|
|
7
9
|
xml do
|
8
|
-
root
|
9
|
-
namespace
|
10
|
+
root 'import'
|
11
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
10
12
|
|
11
|
-
map_attribute
|
13
|
+
map_attribute 'href', to: :href
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require_relative
|
6
|
-
require_relative
|
3
|
+
require 'lutaml/model'
|
4
|
+
|
5
|
+
require_relative 'key_field'
|
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 IndexHasKeyConstraintType < Lutaml::Model::Serializable
|
10
12
|
attribute :id, :string
|
11
|
-
attribute :level, :string, default: -> {
|
13
|
+
attribute :level, :string, default: -> { 'ERROR' }
|
12
14
|
attribute :name, :string
|
13
15
|
attribute :formal_name, :string
|
14
16
|
attribute :description, MarkupLineDatatype
|
@@ -17,17 +19,17 @@ module Metaschema
|
|
17
19
|
attribute :remarks, RemarksType
|
18
20
|
|
19
21
|
xml do
|
20
|
-
root
|
21
|
-
namespace
|
22
|
+
root 'IndexHasKeyConstraintType'
|
23
|
+
namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
|
22
24
|
|
23
|
-
map_attribute
|
24
|
-
map_attribute
|
25
|
-
map_attribute
|
26
|
-
map_element
|
27
|
-
map_element
|
28
|
-
map_element
|
29
|
-
map_element
|
30
|
-
map_element
|
25
|
+
map_attribute 'id', to: :id
|
26
|
+
map_attribute 'level', to: :level
|
27
|
+
map_attribute 'name', to: :name
|
28
|
+
map_element 'formal-name', to: :formal_name
|
29
|
+
map_element 'description', to: :description
|
30
|
+
map_element 'prop', to: :prop
|
31
|
+
map_element 'key-field', to: :key_field
|
32
|
+
map_element 'remarks', to: :remarks
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|