metaschema 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.adoc +128 -0
- data/Rakefile +12 -0
- data/exe/metaschema +7 -0
- data/lib/metaschema/allowed_value_type.rb +48 -0
- data/lib/metaschema/allowed_values_type.rb +35 -0
- data/lib/metaschema/anchor_type.rb +40 -0
- data/lib/metaschema/any_type.rb +10 -0
- data/lib/metaschema/assembly.rb +42 -0
- data/lib/metaschema/assembly_model_type.rb +34 -0
- data/lib/metaschema/assembly_reference_type.rb +40 -0
- data/lib/metaschema/block_quote_type.rb +47 -0
- data/lib/metaschema/choice_type.rb +25 -0
- data/lib/metaschema/code_type.rb +45 -0
- data/lib/metaschema/constraint_let_type.rb +20 -0
- data/lib/metaschema/define_assembly_constraints_type.rb +40 -0
- data/lib/metaschema/define_field_constraints_type.rb +31 -0
- data/lib/metaschema/define_flag_constraints_type.rb +31 -0
- data/lib/metaschema/example_type.rb +23 -0
- data/lib/metaschema/expect_constraint_type.rb +32 -0
- data/lib/metaschema/field.rb +33 -0
- data/lib/metaschema/field_reference_type.rb +44 -0
- data/lib/metaschema/flag.rb +33 -0
- data/lib/metaschema/flag_reference_type.rb +37 -0
- data/lib/metaschema/global_assembly_definition_type.rb +56 -0
- data/lib/metaschema/global_field_definition_type.rb +59 -0
- data/lib/metaschema/global_flag_definition_type.rb +45 -0
- data/lib/metaschema/group_as_type.rb +18 -0
- data/lib/metaschema/grouped_assembly_reference_type.rb +33 -0
- data/lib/metaschema/grouped_choice_type.rb +37 -0
- data/lib/metaschema/grouped_field_reference_type.rb +33 -0
- data/lib/metaschema/grouped_inline_assembly_definition_type.rb +50 -0
- data/lib/metaschema/grouped_inline_field_definition_type.rb +58 -0
- data/lib/metaschema/image_type.rb +18 -0
- data/lib/metaschema/import.rb +14 -0
- data/lib/metaschema/index_has_key_constraint_type.rb +33 -0
- data/lib/metaschema/inline_assembly_definition_type.rb +62 -0
- data/lib/metaschema/inline_field_definition_type.rb +65 -0
- data/lib/metaschema/inline_flag_definition_type.rb +42 -0
- data/lib/metaschema/inline_markup_type.rb +49 -0
- data/lib/metaschema/insert_type.rb +16 -0
- data/lib/metaschema/json_key_type.rb +14 -0
- data/lib/metaschema/json_value_key_flag_type.rb +14 -0
- data/lib/metaschema/key_field.rb +20 -0
- data/lib/metaschema/list_item_type.rb +75 -0
- data/lib/metaschema/list_type.rb +16 -0
- data/lib/metaschema/markup_line_datatype.rb +44 -0
- data/lib/metaschema/matches_constraint_type.rb +32 -0
- data/lib/metaschema/metaschema_import_type.rb +14 -0
- data/lib/metaschema/metaschemaconstraints.rb +29 -0
- data/lib/metaschema/namespace_binding_type.rb +16 -0
- data/lib/metaschema/ordered_list_type.rb +20 -0
- data/lib/metaschema/preformatted_type.rb +44 -0
- data/lib/metaschema/property_type.rb +18 -0
- data/lib/metaschema/remarks_type.rb +50 -0
- data/lib/metaschema/root.rb +47 -0
- data/lib/metaschema/root_name.rb +16 -0
- data/lib/metaschema/scope.rb +26 -0
- data/lib/metaschema/table_cell_type.rb +46 -0
- data/lib/metaschema/table_row_type.rb +18 -0
- data/lib/metaschema/table_type.rb +16 -0
- data/lib/metaschema/targeted_allowed_values_constraint_type.rb +37 -0
- data/lib/metaschema/targeted_expect_constraint_type.rb +34 -0
- data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +34 -0
- data/lib/metaschema/targeted_index_constraint_type.rb +35 -0
- data/lib/metaschema/targeted_index_has_key_constraint_type.rb +35 -0
- data/lib/metaschema/targeted_key_constraint_type.rb +33 -0
- data/lib/metaschema/targeted_matches_constraint_type.rb +34 -0
- data/lib/metaschema/use_name_type.rb +16 -0
- data/lib/metaschema/version.rb +5 -0
- data/lib/metaschema.rb +20 -0
- data/sig/metaschema.rbs +4 -0
- metadata +243 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "markup_line_datatype"
|
4
|
+
require_relative "remarks_type"
|
5
|
+
|
6
|
+
module Metaschema
|
7
|
+
class ExampleType < Lutaml::Model::Serializable
|
8
|
+
attribute :href, :string
|
9
|
+
attribute :path, :string
|
10
|
+
attribute :description, MarkupLineDatatype
|
11
|
+
attribute :remarks, RemarksType
|
12
|
+
|
13
|
+
xml do
|
14
|
+
root "ExampleType"
|
15
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
16
|
+
|
17
|
+
map_attribute "href", to: :href
|
18
|
+
map_attribute "path", to: :path
|
19
|
+
map_element "description", to: :description
|
20
|
+
map_element "remarks", to: :remarks
|
21
|
+
end
|
22
|
+
end
|
23
|
+
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 ExpectConstraintType < Lutaml::Model::Serializable
|
9
|
+
attribute :id, :string
|
10
|
+
attribute :level, :string, default: -> { "ERROR" }
|
11
|
+
attribute :test, :string
|
12
|
+
attribute :formal_name, :string
|
13
|
+
attribute :description, MarkupLineDatatype
|
14
|
+
attribute :prop, PropertyType, collection: true
|
15
|
+
attribute :message, :string
|
16
|
+
attribute :remarks, RemarksType
|
17
|
+
|
18
|
+
xml do
|
19
|
+
root "ExpectConstraintType"
|
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 "test", to: :test
|
25
|
+
map_element "formal-name", to: :formal_name
|
26
|
+
map_element "description", to: :description
|
27
|
+
map_element "prop", to: :prop
|
28
|
+
map_element "message", to: :message
|
29
|
+
map_element "remarks", to: :remarks
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "constraint_let_type"
|
4
|
+
require_relative "remarks_type"
|
5
|
+
require_relative "targeted_allowed_values_constraint_type"
|
6
|
+
require_relative "targeted_expect_constraint_type"
|
7
|
+
require_relative "targeted_index_has_key_constraint_type"
|
8
|
+
require_relative "targeted_matches_constraint_type"
|
9
|
+
|
10
|
+
module Metaschema
|
11
|
+
class Field < Lutaml::Model::Serializable
|
12
|
+
attribute :target, :string
|
13
|
+
attribute :let, ConstraintLetType, collection: true
|
14
|
+
attribute :allowed_values, TargetedAllowedValuesConstraintType, collection: true
|
15
|
+
attribute :matches, TargetedMatchesConstraintType, collection: true
|
16
|
+
attribute :index_has_key, TargetedIndexHasKeyConstraintType, collection: true
|
17
|
+
attribute :expect, TargetedExpectConstraintType, collection: true
|
18
|
+
attribute :remarks, RemarksType
|
19
|
+
|
20
|
+
xml do
|
21
|
+
root "field"
|
22
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
23
|
+
|
24
|
+
map_attribute "target", to: :target
|
25
|
+
map_element "let", to: :let
|
26
|
+
map_element "allowed-values", to: :allowed_values
|
27
|
+
map_element "matches", to: :matches
|
28
|
+
map_element "index-has-key", to: :index_has_key
|
29
|
+
map_element "expect", to: :expect
|
30
|
+
map_element "remarks", to: :remarks
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "group_as_type"
|
4
|
+
require_relative "markup_line_datatype"
|
5
|
+
require_relative "property_type"
|
6
|
+
require_relative "remarks_type"
|
7
|
+
require_relative "use_name_type"
|
8
|
+
|
9
|
+
module Metaschema
|
10
|
+
class FieldReferenceType < Lutaml::Model::Serializable
|
11
|
+
attribute :ref, :string
|
12
|
+
attribute :index, :integer
|
13
|
+
attribute :min_occurs, :integer, default: -> { "0" }
|
14
|
+
attribute :max_occurs, :string, default: -> { "1" }
|
15
|
+
attribute :in_xml, :string, default: -> { "WRAPPED" }
|
16
|
+
attribute :default, :string
|
17
|
+
attribute :deprecated, :string
|
18
|
+
attribute :formal_name, :string
|
19
|
+
attribute :description, MarkupLineDatatype
|
20
|
+
attribute :prop, PropertyType, collection: true
|
21
|
+
attribute :use_name, UseNameType
|
22
|
+
attribute :group_as, GroupAsType
|
23
|
+
attribute :remarks, RemarksType
|
24
|
+
|
25
|
+
xml do
|
26
|
+
root "FieldReferenceType"
|
27
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
28
|
+
|
29
|
+
map_attribute "ref", to: :ref
|
30
|
+
map_attribute "index", to: :index
|
31
|
+
map_attribute "min-occurs", to: :min_occurs
|
32
|
+
map_attribute "max-occurs", to: :max_occurs
|
33
|
+
map_attribute "in-xml", to: :in_xml
|
34
|
+
map_attribute "default", to: :default
|
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 "use-name", to: :use_name
|
40
|
+
map_element "group-as", to: :group_as
|
41
|
+
map_element "remarks", to: :remarks
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "allowed_values_type"
|
4
|
+
require_relative "constraint_let_type"
|
5
|
+
require_relative "expect_constraint_type"
|
6
|
+
require_relative "index_has_key_constraint_type"
|
7
|
+
require_relative "matches_constraint_type"
|
8
|
+
require_relative "remarks_type"
|
9
|
+
|
10
|
+
module Metaschema
|
11
|
+
class Flag < Lutaml::Model::Serializable
|
12
|
+
attribute :target, :string
|
13
|
+
attribute :let, ConstraintLetType, collection: true
|
14
|
+
attribute :allowed_values, AllowedValuesType, collection: true
|
15
|
+
attribute :matches, MatchesConstraintType, collection: true
|
16
|
+
attribute :index_has_key, IndexHasKeyConstraintType, collection: true
|
17
|
+
attribute :expect, ExpectConstraintType, collection: true
|
18
|
+
attribute :remarks, RemarksType
|
19
|
+
|
20
|
+
xml do
|
21
|
+
root "flag"
|
22
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
23
|
+
|
24
|
+
map_attribute "target", to: :target
|
25
|
+
map_element "let", to: :let
|
26
|
+
map_element "allowed-values", to: :allowed_values
|
27
|
+
map_element "matches", to: :matches
|
28
|
+
map_element "index-has-key", to: :index_has_key
|
29
|
+
map_element "expect", to: :expect
|
30
|
+
map_element "remarks", to: :remarks
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "markup_line_datatype"
|
4
|
+
require_relative "property_type"
|
5
|
+
require_relative "remarks_type"
|
6
|
+
require_relative "use_name_type"
|
7
|
+
|
8
|
+
module Metaschema
|
9
|
+
class FlagReferenceType < Lutaml::Model::Serializable
|
10
|
+
attribute :ref, :string
|
11
|
+
attribute :index, :integer
|
12
|
+
attribute :required, :string, default: -> { "no" }
|
13
|
+
attribute :default, :string
|
14
|
+
attribute :deprecated, :string
|
15
|
+
attribute :formal_name, :string
|
16
|
+
attribute :description, MarkupLineDatatype
|
17
|
+
attribute :prop, PropertyType, collection: true
|
18
|
+
attribute :use_name, UseNameType
|
19
|
+
attribute :remarks, RemarksType
|
20
|
+
|
21
|
+
xml do
|
22
|
+
root "FlagReferenceType"
|
23
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
24
|
+
|
25
|
+
map_attribute "ref", to: :ref
|
26
|
+
map_attribute "index", to: :index
|
27
|
+
map_attribute "required", to: :required
|
28
|
+
map_attribute "default", to: :default
|
29
|
+
map_attribute "deprecated", to: :deprecated
|
30
|
+
map_element "formal-name", to: :formal_name
|
31
|
+
map_element "description", to: :description
|
32
|
+
map_element "prop", to: :prop
|
33
|
+
map_element "use-name", to: :use_name
|
34
|
+
map_element "remarks", to: :remarks
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,56 @@
|
|
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 "inline_flag_definition_type"
|
8
|
+
require_relative "json_key_type"
|
9
|
+
require_relative "markup_line_datatype"
|
10
|
+
require_relative "property_type"
|
11
|
+
require_relative "remarks_type"
|
12
|
+
require_relative "root_name"
|
13
|
+
require_relative "use_name_type"
|
14
|
+
|
15
|
+
module Metaschema
|
16
|
+
class GlobalAssemblyDefinitionType < Lutaml::Model::Serializable
|
17
|
+
attribute :name, :string
|
18
|
+
attribute :index, :integer
|
19
|
+
attribute :scope, :string, default: -> { "global" }
|
20
|
+
attribute :deprecated, :string
|
21
|
+
attribute :formal_name, :string
|
22
|
+
attribute :description, MarkupLineDatatype
|
23
|
+
attribute :prop, PropertyType, collection: true
|
24
|
+
attribute :root_name, RootName
|
25
|
+
attribute :use_name, UseNameType
|
26
|
+
attribute :json_key, JsonKeyType
|
27
|
+
attribute :flag, FlagReferenceType, collection: true
|
28
|
+
attribute :define_flag, InlineFlagDefinitionType, collection: true
|
29
|
+
attribute :model, AssemblyModelType
|
30
|
+
attribute :constraint, DefineAssemblyConstraintsType
|
31
|
+
attribute :remarks, RemarksType
|
32
|
+
attribute :example, ExampleType, collection: true
|
33
|
+
|
34
|
+
xml do
|
35
|
+
root "GlobalAssemblyDefinitionType"
|
36
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
37
|
+
|
38
|
+
map_attribute "name", to: :name
|
39
|
+
map_attribute "index", to: :index
|
40
|
+
map_attribute "scope", to: :scope
|
41
|
+
map_attribute "deprecated", to: :deprecated
|
42
|
+
map_element "formal-name", to: :formal_name
|
43
|
+
map_element "description", to: :description
|
44
|
+
map_element "prop", to: :prop
|
45
|
+
map_element "root-name", to: :root_name
|
46
|
+
map_element "use-name", to: :use_name
|
47
|
+
map_element "json-key", to: :json_key
|
48
|
+
map_element "flag", to: :flag
|
49
|
+
map_element "define-flag", to: :define_flag
|
50
|
+
map_element "model", to: :model
|
51
|
+
map_element "constraint", to: :constraint
|
52
|
+
map_element "remarks", to: :remarks
|
53
|
+
map_element "example", to: :example
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,59 @@
|
|
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 "inline_flag_definition_type"
|
7
|
+
require_relative "json_key_type"
|
8
|
+
require_relative "json_value_key_flag_type"
|
9
|
+
require_relative "markup_line_datatype"
|
10
|
+
require_relative "property_type"
|
11
|
+
require_relative "remarks_type"
|
12
|
+
require_relative "use_name_type"
|
13
|
+
|
14
|
+
module Metaschema
|
15
|
+
class GlobalFieldDefinitionType < Lutaml::Model::Serializable
|
16
|
+
attribute :as_type, :string, default: -> { "string" }
|
17
|
+
attribute :default, :string
|
18
|
+
attribute :name, :string
|
19
|
+
attribute :index, :integer
|
20
|
+
attribute :scope, :string, default: -> { "global" }
|
21
|
+
attribute :deprecated, :string
|
22
|
+
attribute :formal_name, :string
|
23
|
+
attribute :description, MarkupLineDatatype
|
24
|
+
attribute :prop, PropertyType, collection: true
|
25
|
+
attribute :use_name, UseNameType
|
26
|
+
attribute :json_key, JsonKeyType
|
27
|
+
attribute :json_value_key, :string
|
28
|
+
attribute :json_value_key_flag, JsonValueKeyFlagType
|
29
|
+
attribute :flag, FlagReferenceType, collection: true
|
30
|
+
attribute :define_flag, InlineFlagDefinitionType, collection: true
|
31
|
+
attribute :constraint, DefineFieldConstraintsType
|
32
|
+
attribute :remarks, RemarksType
|
33
|
+
attribute :example, ExampleType, collection: true
|
34
|
+
|
35
|
+
xml do
|
36
|
+
root "GlobalFieldDefinitionType"
|
37
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
38
|
+
|
39
|
+
map_attribute "as-type", to: :as_type
|
40
|
+
map_attribute "default", to: :default
|
41
|
+
map_attribute "name", to: :name
|
42
|
+
map_attribute "index", to: :index
|
43
|
+
map_attribute "scope", to: :scope
|
44
|
+
map_attribute "deprecated", to: :deprecated
|
45
|
+
map_element "formal-name", to: :formal_name
|
46
|
+
map_element "description", to: :description
|
47
|
+
map_element "prop", to: :prop
|
48
|
+
map_element "use-name", to: :use_name
|
49
|
+
map_element "json-key", to: :json_key
|
50
|
+
map_element "json-value-key", to: :json_value_key
|
51
|
+
map_element "json-value-key-flag", to: :json_value_key_flag
|
52
|
+
map_element "flag", to: :flag
|
53
|
+
map_element "define-flag", to: :define_flag
|
54
|
+
map_element "constraint", to: :constraint
|
55
|
+
map_element "remarks", to: :remarks
|
56
|
+
map_element "example", to: :example
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,45 @@
|
|
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
|
+
require_relative "use_name_type"
|
9
|
+
|
10
|
+
module Metaschema
|
11
|
+
class GlobalFlagDefinitionType < Lutaml::Model::Serializable
|
12
|
+
attribute :name, :string
|
13
|
+
attribute :index, :integer
|
14
|
+
attribute :as_type, :string, default: -> { "string" }
|
15
|
+
attribute :default, :string
|
16
|
+
attribute :scope, :string, default: -> { "global" }
|
17
|
+
attribute :deprecated, :string
|
18
|
+
attribute :formal_name, :string
|
19
|
+
attribute :description, MarkupLineDatatype
|
20
|
+
attribute :prop, PropertyType, collection: true
|
21
|
+
attribute :use_name, UseNameType
|
22
|
+
attribute :constraint, DefineFlagConstraintsType
|
23
|
+
attribute :remarks, RemarksType
|
24
|
+
attribute :example, ExampleType, collection: true
|
25
|
+
|
26
|
+
xml do
|
27
|
+
root "GlobalFlagDefinitionType"
|
28
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
29
|
+
|
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 "scope", to: :scope
|
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 "use-name", to: :use_name
|
40
|
+
map_element "constraint", to: :constraint
|
41
|
+
map_element "remarks", to: :remarks
|
42
|
+
map_element "example", to: :example
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
module Metaschema
|
4
|
+
class GroupAsType < Lutaml::Model::Serializable
|
5
|
+
attribute :name, :string
|
6
|
+
attribute :in_json, :string, default: -> { "SINGLETON_OR_ARRAY" }
|
7
|
+
attribute :in_xml, :string, default: -> { "UNGROUPED" }
|
8
|
+
|
9
|
+
xml do
|
10
|
+
root "GroupAsType"
|
11
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
12
|
+
|
13
|
+
map_attribute "name", to: :name
|
14
|
+
map_attribute "in-json", to: :in_json
|
15
|
+
map_attribute "in-xml", to: :in_xml
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "markup_line_datatype"
|
4
|
+
require_relative "property_type"
|
5
|
+
require_relative "remarks_type"
|
6
|
+
require_relative "use_name_type"
|
7
|
+
|
8
|
+
module Metaschema
|
9
|
+
class GroupedAssemblyReferenceType < Lutaml::Model::Serializable
|
10
|
+
attribute :ref, :string
|
11
|
+
attribute :deprecated, :string
|
12
|
+
attribute :formal_name, :string
|
13
|
+
attribute :description, MarkupLineDatatype
|
14
|
+
attribute :prop, PropertyType, collection: true
|
15
|
+
attribute :use_name, UseNameType
|
16
|
+
attribute :discriminator_value, :string
|
17
|
+
attribute :remarks, RemarksType
|
18
|
+
|
19
|
+
xml do
|
20
|
+
root "GroupedAssemblyReferenceType"
|
21
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
22
|
+
|
23
|
+
map_attribute "ref", to: :ref
|
24
|
+
map_attribute "deprecated", to: :deprecated
|
25
|
+
map_element "formal-name", to: :formal_name
|
26
|
+
map_element "description", to: :description
|
27
|
+
map_element "prop", to: :prop
|
28
|
+
map_element "use-name", to: :use_name
|
29
|
+
map_element "discriminator-value", to: :discriminator_value
|
30
|
+
map_element "remarks", to: :remarks
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "group_as_type"
|
4
|
+
require_relative "grouped_assembly_reference_type"
|
5
|
+
require_relative "grouped_field_reference_type"
|
6
|
+
require_relative "grouped_inline_assembly_definition_type"
|
7
|
+
require_relative "grouped_inline_field_definition_type"
|
8
|
+
require_relative "json_key_type"
|
9
|
+
|
10
|
+
module Metaschema
|
11
|
+
class GroupedChoiceType < Lutaml::Model::Serializable
|
12
|
+
attribute :min_occurs, :integer, default: -> { "0" }
|
13
|
+
attribute :max_occurs, :string, default: -> { "unbounded" }
|
14
|
+
attribute :json_key, JsonKeyType
|
15
|
+
attribute :group_as, GroupAsType
|
16
|
+
attribute :discriminator, :string, default: -> { "object-type" }
|
17
|
+
attribute :assembly, GroupedAssemblyReferenceType, collection: true
|
18
|
+
attribute :field, GroupedFieldReferenceType, collection: true
|
19
|
+
attribute :define_assembly, GroupedInlineAssemblyDefinitionType, collection: true
|
20
|
+
attribute :define_field, GroupedInlineFieldDefinitionType, collection: true
|
21
|
+
|
22
|
+
xml do
|
23
|
+
root "GroupedChoiceType"
|
24
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
25
|
+
|
26
|
+
map_attribute "min-occurs", to: :min_occurs
|
27
|
+
map_attribute "max-occurs", to: :max_occurs
|
28
|
+
map_element "json-key", to: :json_key
|
29
|
+
map_element "group-as", to: :group_as
|
30
|
+
map_element "discriminator", to: :discriminator
|
31
|
+
map_element "assembly", to: :assembly
|
32
|
+
map_element "field", to: :field
|
33
|
+
map_element "define-assembly", to: :define_assembly
|
34
|
+
map_element "define-field", to: :define_field
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "markup_line_datatype"
|
4
|
+
require_relative "property_type"
|
5
|
+
require_relative "remarks_type"
|
6
|
+
require_relative "use_name_type"
|
7
|
+
|
8
|
+
module Metaschema
|
9
|
+
class GroupedFieldReferenceType < Lutaml::Model::Serializable
|
10
|
+
attribute :ref, :string
|
11
|
+
attribute :deprecated, :string
|
12
|
+
attribute :formal_name, :string
|
13
|
+
attribute :description, MarkupLineDatatype
|
14
|
+
attribute :prop, PropertyType, collection: true
|
15
|
+
attribute :use_name, UseNameType
|
16
|
+
attribute :discriminator_value, :string
|
17
|
+
attribute :remarks, RemarksType
|
18
|
+
|
19
|
+
xml do
|
20
|
+
root "GroupedFieldReferenceType"
|
21
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
22
|
+
|
23
|
+
map_attribute "ref", to: :ref
|
24
|
+
map_attribute "deprecated", to: :deprecated
|
25
|
+
map_element "formal-name", to: :formal_name
|
26
|
+
map_element "description", to: :description
|
27
|
+
map_element "prop", to: :prop
|
28
|
+
map_element "use-name", to: :use_name
|
29
|
+
map_element "discriminator-value", to: :discriminator_value
|
30
|
+
map_element "remarks", to: :remarks
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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 "inline_flag_definition_type"
|
8
|
+
require_relative "markup_line_datatype"
|
9
|
+
require_relative "property_type"
|
10
|
+
require_relative "remarks_type"
|
11
|
+
require_relative "use_name_type"
|
12
|
+
|
13
|
+
module Metaschema
|
14
|
+
class GroupedInlineAssemblyDefinitionType < Lutaml::Model::Serializable
|
15
|
+
attribute :name, :string
|
16
|
+
attribute :index, :integer
|
17
|
+
attribute :deprecated, :string
|
18
|
+
attribute :formal_name, :string
|
19
|
+
attribute :description, MarkupLineDatatype
|
20
|
+
attribute :prop, PropertyType, collection: true
|
21
|
+
attribute :use_name, UseNameType
|
22
|
+
attribute :discriminator_value, :string
|
23
|
+
attribute :flag, FlagReferenceType, collection: true
|
24
|
+
attribute :define_flag, InlineFlagDefinitionType, collection: true
|
25
|
+
attribute :model, AssemblyModelType
|
26
|
+
attribute :constraint, DefineAssemblyConstraintsType
|
27
|
+
attribute :remarks, RemarksType
|
28
|
+
attribute :example, ExampleType, collection: true
|
29
|
+
|
30
|
+
xml do
|
31
|
+
root "GroupedInlineAssemblyDefinitionType"
|
32
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
33
|
+
|
34
|
+
map_attribute "name", to: :name
|
35
|
+
map_attribute "index", to: :index
|
36
|
+
map_attribute "deprecated", to: :deprecated
|
37
|
+
map_element "formal-name", to: :formal_name
|
38
|
+
map_element "description", to: :description
|
39
|
+
map_element "prop", to: :prop
|
40
|
+
map_element "use-name", to: :use_name
|
41
|
+
map_element "discriminator-value", to: :discriminator_value
|
42
|
+
map_element "flag", to: :flag
|
43
|
+
map_element "define-flag", to: :define_flag
|
44
|
+
map_element "model", to: :model
|
45
|
+
map_element "constraint", to: :constraint
|
46
|
+
map_element "remarks", to: :remarks
|
47
|
+
map_element "example", to: :example
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,58 @@
|
|
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 "inline_flag_definition_type"
|
7
|
+
require_relative "json_value_key_flag_type"
|
8
|
+
require_relative "markup_line_datatype"
|
9
|
+
require_relative "property_type"
|
10
|
+
require_relative "remarks_type"
|
11
|
+
require_relative "use_name_type"
|
12
|
+
|
13
|
+
module Metaschema
|
14
|
+
class GroupedInlineFieldDefinitionType < Lutaml::Model::Serializable
|
15
|
+
attribute :as_type, :string, default: -> { "string" }
|
16
|
+
attribute :collapsible, :string, default: -> { "no" }
|
17
|
+
attribute :name, :string
|
18
|
+
attribute :index, :integer
|
19
|
+
attribute :in_xml, :string, default: -> { "WRAPPED" }
|
20
|
+
attribute :deprecated, :string
|
21
|
+
attribute :formal_name, :string
|
22
|
+
attribute :description, MarkupLineDatatype
|
23
|
+
attribute :prop, PropertyType, collection: true
|
24
|
+
attribute :use_name, UseNameType
|
25
|
+
attribute :discriminator_value, :string
|
26
|
+
attribute :json_value_key, :string
|
27
|
+
attribute :json_value_key_flag, JsonValueKeyFlagType
|
28
|
+
attribute :flag, FlagReferenceType, collection: true
|
29
|
+
attribute :define_flag, InlineFlagDefinitionType, collection: true
|
30
|
+
attribute :constraint, DefineFieldConstraintsType
|
31
|
+
attribute :remarks, RemarksType
|
32
|
+
attribute :example, ExampleType, collection: true
|
33
|
+
|
34
|
+
xml do
|
35
|
+
root "GroupedInlineFieldDefinitionType"
|
36
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
37
|
+
|
38
|
+
map_attribute "as-type", to: :as_type
|
39
|
+
map_attribute "collapsible", to: :collapsible
|
40
|
+
map_attribute "name", to: :name
|
41
|
+
map_attribute "index", to: :index
|
42
|
+
map_attribute "in-xml", to: :in_xml
|
43
|
+
map_attribute "deprecated", to: :deprecated
|
44
|
+
map_element "formal-name", to: :formal_name
|
45
|
+
map_element "description", to: :description
|
46
|
+
map_element "prop", to: :prop
|
47
|
+
map_element "use-name", to: :use_name
|
48
|
+
map_element "discriminator-value", to: :discriminator_value
|
49
|
+
map_element "json-value-key", to: :json_value_key
|
50
|
+
map_element "json-value-key-flag", to: :json_value_key_flag
|
51
|
+
map_element "flag", to: :flag
|
52
|
+
map_element "define-flag", to: :define_flag
|
53
|
+
map_element "constraint", to: :constraint
|
54
|
+
map_element "remarks", to: :remarks
|
55
|
+
map_element "example", to: :example
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
module Metaschema
|
4
|
+
class ImageType < Lutaml::Model::Serializable
|
5
|
+
attribute :alt, :string
|
6
|
+
attribute :src, :string
|
7
|
+
attribute :title, :string
|
8
|
+
|
9
|
+
xml do
|
10
|
+
root "imageType"
|
11
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
12
|
+
|
13
|
+
map_attribute "alt", to: :alt
|
14
|
+
map_attribute "src", to: :src
|
15
|
+
map_attribute "title", to: :title
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
module Metaschema
|
4
|
+
class Import < Lutaml::Model::Serializable
|
5
|
+
attribute :href, :string
|
6
|
+
|
7
|
+
xml do
|
8
|
+
root "import"
|
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,33 @@
|
|
1
|
+
require "lutaml/model"
|
2
|
+
|
3
|
+
require_relative "key_field"
|
4
|
+
require_relative "markup_line_datatype"
|
5
|
+
require_relative "property_type"
|
6
|
+
require_relative "remarks_type"
|
7
|
+
|
8
|
+
module Metaschema
|
9
|
+
class IndexHasKeyConstraintType < Lutaml::Model::Serializable
|
10
|
+
attribute :id, :string
|
11
|
+
attribute :level, :string, default: -> { "ERROR" }
|
12
|
+
attribute :name, :string
|
13
|
+
attribute :formal_name, :string
|
14
|
+
attribute :description, MarkupLineDatatype
|
15
|
+
attribute :prop, PropertyType, collection: true
|
16
|
+
attribute :key_field, KeyField, collection: true
|
17
|
+
attribute :remarks, RemarksType
|
18
|
+
|
19
|
+
xml do
|
20
|
+
root "IndexHasKeyConstraintType"
|
21
|
+
namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
|
22
|
+
|
23
|
+
map_attribute "id", to: :id
|
24
|
+
map_attribute "level", to: :level
|
25
|
+
map_attribute "name", to: :name
|
26
|
+
map_element "formal-name", to: :formal_name
|
27
|
+
map_element "description", to: :description
|
28
|
+
map_element "prop", to: :prop
|
29
|
+
map_element "key-field", to: :key_field
|
30
|
+
map_element "remarks", to: :remarks
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|