metaschema 0.1.0 → 0.1.1

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec_status +64 -0
  3. data/.rubocop.yml +1 -0
  4. data/.rubocop_todo.yml +76 -0
  5. data/Rakefile +3 -3
  6. data/exe/metaschema +2 -2
  7. data/lib/metaschema/allowed_value_type.rb +24 -22
  8. data/lib/metaschema/allowed_values_type.rb +21 -19
  9. data/lib/metaschema/anchor_type.rb +19 -17
  10. data/lib/metaschema/any_type.rb +5 -3
  11. data/lib/metaschema/assembly.rb +24 -22
  12. data/lib/metaschema/assembly_model_type.rb +19 -17
  13. data/lib/metaschema/assembly_reference_type.rb +23 -21
  14. data/lib/metaschema/block_quote_type.rb +25 -23
  15. data/lib/metaschema/choice_type.rb +13 -11
  16. data/lib/metaschema/code_type.rb +23 -21
  17. data/lib/metaschema/constraint_let_type.rb +9 -7
  18. data/lib/metaschema/define_assembly_constraints_type.rb +23 -21
  19. data/lib/metaschema/define_field_constraints_type.rb +17 -15
  20. data/lib/metaschema/define_flag_constraints_type.rb +17 -15
  21. data/lib/metaschema/example_type.rb +11 -9
  22. data/lib/metaschema/expect_constraint_type.rb +17 -15
  23. data/lib/metaschema/field.rb +18 -16
  24. data/lib/metaschema/field_reference_type.rb +26 -24
  25. data/lib/metaschema/flag.rb +18 -16
  26. data/lib/metaschema/flag_reference_type.rb +20 -18
  27. data/lib/metaschema/global_assembly_definition_type.rb +33 -31
  28. data/lib/metaschema/global_field_definition_type.rb +37 -33
  29. data/lib/metaschema/global_flag_definition_type.rb +26 -24
  30. data/lib/metaschema/group_as_type.rb +10 -8
  31. data/lib/metaschema/grouped_assembly_reference_type.rb +17 -15
  32. data/lib/metaschema/grouped_choice_type.rb +23 -21
  33. data/lib/metaschema/grouped_field_reference_type.rb +17 -15
  34. data/lib/metaschema/grouped_inline_assembly_definition_type.rb +28 -26
  35. data/lib/metaschema/grouped_inline_field_definition_type.rb +35 -33
  36. data/lib/metaschema/image_type.rb +8 -6
  37. data/lib/metaschema/import.rb +6 -4
  38. data/lib/metaschema/index_has_key_constraint_type.rb +18 -16
  39. data/lib/metaschema/inline_assembly_definition_type.rb +35 -33
  40. data/lib/metaschema/inline_field_definition_type.rb +41 -39
  41. data/lib/metaschema/inline_flag_definition_type.rb +24 -22
  42. data/lib/metaschema/inline_markup_type.rb +19 -17
  43. data/lib/metaschema/insert_type.rb +7 -5
  44. data/lib/metaschema/json_key_type.rb +6 -4
  45. data/lib/metaschema/json_value_key_flag_type.rb +6 -4
  46. data/lib/metaschema/key_field.rb +9 -7
  47. data/lib/metaschema/list_item_type.rb +36 -34
  48. data/lib/metaschema/list_type.rb +7 -5
  49. data/lib/metaschema/markup_line_datatype.rb +22 -20
  50. data/lib/metaschema/matches_constraint_type.rb +17 -15
  51. data/lib/metaschema/metaschema_import_type.rb +6 -4
  52. data/lib/metaschema/metaschemaconstraints.rb +15 -13
  53. data/lib/metaschema/namespace_binding_type.rb +7 -5
  54. data/lib/metaschema/ordered_list_type.rb +7 -5
  55. data/lib/metaschema/preformatted_type.rb +22 -20
  56. data/lib/metaschema/property_type.rb +9 -7
  57. data/lib/metaschema/remarks_type.rb +28 -26
  58. data/lib/metaschema/root.rb +27 -25
  59. data/lib/metaschema/root_name.rb +6 -4
  60. data/lib/metaschema/scope.rb +13 -11
  61. data/lib/metaschema/table_cell_type.rb +24 -22
  62. data/lib/metaschema/table_row_type.rb +8 -6
  63. data/lib/metaschema/table_type.rb +7 -5
  64. data/lib/metaschema/targeted_allowed_values_constraint_type.rb +22 -20
  65. data/lib/metaschema/targeted_expect_constraint_type.rb +18 -16
  66. data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +18 -16
  67. data/lib/metaschema/targeted_index_constraint_type.rb +19 -17
  68. data/lib/metaschema/targeted_index_has_key_constraint_type.rb +19 -17
  69. data/lib/metaschema/targeted_key_constraint_type.rb +18 -16
  70. data/lib/metaschema/targeted_matches_constraint_type.rb +18 -16
  71. data/lib/metaschema/use_name_type.rb +6 -4
  72. data/lib/metaschema/version.rb +1 -1
  73. data/lib/metaschema.rb +4 -4
  74. metadata +9 -6
@@ -1,14 +1,16 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "anchor_type"
4
- require_relative "image_type"
5
- require_relative "inline_markup_type"
6
- require_relative "insert_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'anchor_type'
6
+ require_relative 'image_type'
7
+ require_relative 'inline_markup_type'
8
+ require_relative 'insert_type'
7
9
 
8
10
  module Metaschema
9
11
  class CodeType < Lutaml::Model::Serializable
10
12
  attribute :content, :string
11
- attribute :class, :string
13
+ attribute :klass, :string
12
14
  attribute :a, AnchorType, collection: true
13
15
  attribute :insert, InsertType, collection: true
14
16
  attribute :br, :string, collection: true
@@ -23,23 +25,23 @@ module Metaschema
23
25
  attribute :img, ImageType, collection: true
24
26
 
25
27
  xml do
26
- root "codeType"
27
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
28
+ root 'codeType', mixed: true
29
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
28
30
 
29
31
  map_content to: :content
30
- map_attribute "class", to: :class
31
- map_element "a", to: :a
32
- map_element "insert", to: :insert
33
- map_element "br", to: :br
34
- map_element "code", to: :code
35
- map_element "em", to: :em
36
- map_element "i", to: :i
37
- map_element "b", to: :b
38
- map_element "strong", to: :strong
39
- map_element "sub", to: :sub
40
- map_element "sup", to: :sup
41
- map_element "q", to: :q
42
- map_element "img", to: :img
32
+ map_attribute 'class', to: :klass
33
+ map_element 'a', to: :a
34
+ map_element 'insert', to: :insert
35
+ map_element 'br', to: :br
36
+ map_element 'code', to: :code
37
+ map_element 'em', to: :em
38
+ map_element 'i', to: :i
39
+ map_element 'b', to: :b
40
+ map_element 'strong', to: :strong
41
+ map_element 'sub', to: :sub
42
+ map_element 'sup', to: :sup
43
+ map_element 'q', to: :q
44
+ map_element 'img', to: :img
43
45
  end
44
46
  end
45
47
  end
@@ -1,6 +1,8 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "remarks_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'remarks_type'
4
6
 
5
7
  module Metaschema
6
8
  class ConstraintLetType < Lutaml::Model::Serializable
@@ -9,12 +11,12 @@ module Metaschema
9
11
  attribute :remarks, RemarksType
10
12
 
11
13
  xml do
12
- root "ConstraintLetType"
13
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
14
+ root 'ConstraintLetType'
15
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
14
16
 
15
- map_attribute "var", to: :var
16
- map_attribute "expression", to: :expression
17
- map_element "remarks", to: :remarks
17
+ map_attribute 'var', to: :var
18
+ map_attribute 'expression', to: :expression
19
+ map_element 'remarks', to: :remarks
18
20
  end
19
21
  end
20
22
  end
@@ -1,14 +1,16 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
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_has_cardinality_constraint_type"
8
- require_relative "targeted_index_constraint_type"
9
- require_relative "targeted_index_has_key_constraint_type"
10
- require_relative "targeted_key_constraint_type"
11
- require_relative "targeted_matches_constraint_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'constraint_let_type'
6
+ require_relative 'remarks_type'
7
+ require_relative 'targeted_allowed_values_constraint_type'
8
+ require_relative 'targeted_expect_constraint_type'
9
+ require_relative 'targeted_has_cardinality_constraint_type'
10
+ require_relative 'targeted_index_constraint_type'
11
+ require_relative 'targeted_index_has_key_constraint_type'
12
+ require_relative 'targeted_key_constraint_type'
13
+ require_relative 'targeted_matches_constraint_type'
12
14
 
13
15
  module Metaschema
14
16
  class DefineAssemblyConstraintsType < Lutaml::Model::Serializable
@@ -23,18 +25,18 @@ module Metaschema
23
25
  attribute :remarks, RemarksType
24
26
 
25
27
  xml do
26
- root "DefineAssemblyConstraintsType"
27
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
28
+ root 'DefineAssemblyConstraintsType'
29
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
28
30
 
29
- map_element "let", to: :let
30
- map_element "allowed-values", to: :allowed_values
31
- map_element "matches", to: :matches
32
- map_element "index-has-key", to: :index_has_key
33
- map_element "expect", to: :expect
34
- map_element "index", to: :index
35
- map_element "is-unique", to: :is_unique
36
- map_element "has-cardinality", to: :has_cardinality
37
- map_element "remarks", to: :remarks
31
+ map_element 'let', to: :let
32
+ map_element 'is-unique', to: :is_unique
33
+ map_element 'allowed-values', to: :allowed_values
34
+ map_element 'matches', to: :matches
35
+ map_element 'index-has-key', to: :index_has_key
36
+ map_element 'expect', to: :expect
37
+ map_element 'index', to: :index
38
+ map_element 'has-cardinality', to: :has_cardinality
39
+ map_element 'remarks', to: :remarks
38
40
  end
39
41
  end
40
42
  end
@@ -1,11 +1,13 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
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"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'constraint_let_type'
6
+ require_relative 'remarks_type'
7
+ require_relative 'targeted_allowed_values_constraint_type'
8
+ require_relative 'targeted_expect_constraint_type'
9
+ require_relative 'targeted_index_has_key_constraint_type'
10
+ require_relative 'targeted_matches_constraint_type'
9
11
 
10
12
  module Metaschema
11
13
  class DefineFieldConstraintsType < Lutaml::Model::Serializable
@@ -17,15 +19,15 @@ module Metaschema
17
19
  attribute :remarks, RemarksType
18
20
 
19
21
  xml do
20
- root "DefineFieldConstraintsType"
21
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
22
+ root 'DefineFieldConstraintsType', mixed: true
23
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
22
24
 
23
- map_element "let", to: :let
24
- map_element "allowed-values", to: :allowed_values
25
- map_element "matches", to: :matches
26
- map_element "index-has-key", to: :index_has_key
27
- map_element "expect", to: :expect
28
- map_element "remarks", to: :remarks
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
29
31
  end
30
32
  end
31
33
  end
@@ -1,11 +1,13 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
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"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'allowed_values_type'
6
+ require_relative 'constraint_let_type'
7
+ require_relative 'expect_constraint_type'
8
+ require_relative 'index_has_key_constraint_type'
9
+ require_relative 'matches_constraint_type'
10
+ require_relative 'remarks_type'
9
11
 
10
12
  module Metaschema
11
13
  class DefineFlagConstraintsType < Lutaml::Model::Serializable
@@ -17,15 +19,15 @@ module Metaschema
17
19
  attribute :remarks, RemarksType
18
20
 
19
21
  xml do
20
- root "DefineFlagConstraintsType"
21
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
22
+ root 'DefineFlagConstraintsType', mixed: true
23
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
22
24
 
23
- map_element "let", to: :let
24
- map_element "allowed-values", to: :allowed_values
25
- map_element "matches", to: :matches
26
- map_element "index-has-key", to: :index_has_key
27
- map_element "expect", to: :expect
28
- map_element "remarks", to: :remarks
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
29
31
  end
30
32
  end
31
33
  end
@@ -1,7 +1,9 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "markup_line_datatype"
4
- require_relative "remarks_type"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'markup_line_datatype'
6
+ require_relative 'remarks_type'
5
7
 
6
8
  module Metaschema
7
9
  class ExampleType < Lutaml::Model::Serializable
@@ -11,13 +13,13 @@ module Metaschema
11
13
  attribute :remarks, RemarksType
12
14
 
13
15
  xml do
14
- root "ExampleType"
15
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
16
+ root 'ExampleType'
17
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
16
18
 
17
- map_attribute "href", to: :href
18
- map_attribute "path", to: :path
19
- map_element "description", to: :description
20
- map_element "remarks", to: :remarks
19
+ map_attribute 'href', to: :href
20
+ map_attribute 'path', to: :path
21
+ map_element 'description', to: :description
22
+ map_element 'remarks', to: :remarks
21
23
  end
22
24
  end
23
25
  end
@@ -1,13 +1,15 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "markup_line_datatype"
4
- require_relative "property_type"
5
- require_relative "remarks_type"
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 ExpectConstraintType < Lutaml::Model::Serializable
9
11
  attribute :id, :string
10
- attribute :level, :string, default: -> { "ERROR" }
12
+ attribute :level, :string, default: -> { 'ERROR' }
11
13
  attribute :test, :string
12
14
  attribute :formal_name, :string
13
15
  attribute :description, MarkupLineDatatype
@@ -16,17 +18,17 @@ module Metaschema
16
18
  attribute :remarks, RemarksType
17
19
 
18
20
  xml do
19
- root "ExpectConstraintType"
20
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
21
+ root 'ExpectConstraintType'
22
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
21
23
 
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
24
+ map_attribute 'id', to: :id
25
+ map_attribute 'level', to: :level
26
+ map_attribute 'test', to: :test
27
+ map_element 'formal-name', to: :formal_name
28
+ map_element 'description', to: :description
29
+ map_element 'prop', to: :prop
30
+ map_element 'message', to: :message
31
+ map_element 'remarks', to: :remarks
30
32
  end
31
33
  end
32
34
  end
@@ -1,11 +1,13 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
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"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'constraint_let_type'
6
+ require_relative 'remarks_type'
7
+ require_relative 'targeted_allowed_values_constraint_type'
8
+ require_relative 'targeted_expect_constraint_type'
9
+ require_relative 'targeted_index_has_key_constraint_type'
10
+ require_relative 'targeted_matches_constraint_type'
9
11
 
10
12
  module Metaschema
11
13
  class Field < Lutaml::Model::Serializable
@@ -18,16 +20,16 @@ module Metaschema
18
20
  attribute :remarks, RemarksType
19
21
 
20
22
  xml do
21
- root "field"
22
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
23
+ root 'field'
24
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
23
25
 
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
26
+ map_attribute 'target', to: :target
27
+ map_element 'let', to: :let
28
+ map_element 'allowed-values', to: :allowed_values
29
+ map_element 'matches', to: :matches
30
+ map_element 'index-has-key', to: :index_has_key
31
+ map_element 'expect', to: :expect
32
+ map_element 'remarks', to: :remarks
31
33
  end
32
34
  end
33
35
  end
@@ -1,18 +1,20 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
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"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'group_as_type'
6
+ require_relative 'markup_line_datatype'
7
+ require_relative 'property_type'
8
+ require_relative 'remarks_type'
9
+ require_relative 'use_name_type'
8
10
 
9
11
  module Metaschema
10
12
  class FieldReferenceType < Lutaml::Model::Serializable
11
13
  attribute :ref, :string
12
14
  attribute :index, :integer
13
- attribute :min_occurs, :integer, default: -> { "0" }
14
- attribute :max_occurs, :string, default: -> { "1" }
15
- attribute :in_xml, :string, default: -> { "WRAPPED" }
15
+ attribute :min_occurs, :integer, default: -> { '0' }
16
+ attribute :max_occurs, :string, default: -> { '1' }
17
+ attribute :in_xml, :string, default: -> { 'WRAPPED' }
16
18
  attribute :default, :string
17
19
  attribute :deprecated, :string
18
20
  attribute :formal_name, :string
@@ -23,22 +25,22 @@ module Metaschema
23
25
  attribute :remarks, RemarksType
24
26
 
25
27
  xml do
26
- root "FieldReferenceType"
27
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
28
+ root 'FieldReferenceType'
29
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
28
30
 
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
31
+ map_attribute 'ref', to: :ref
32
+ map_attribute 'index', to: :index
33
+ map_attribute 'min-occurs', to: :min_occurs
34
+ map_attribute 'max-occurs', to: :max_occurs
35
+ map_attribute 'in-xml', to: :in_xml
36
+ map_attribute 'default', to: :default
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 'group-as', to: :group_as
43
+ map_element 'remarks', to: :remarks
42
44
  end
43
45
  end
44
46
  end
@@ -1,11 +1,13 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
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"
3
+ require 'lutaml/model'
4
+
5
+ require_relative 'allowed_values_type'
6
+ require_relative 'constraint_let_type'
7
+ require_relative 'expect_constraint_type'
8
+ require_relative 'index_has_key_constraint_type'
9
+ require_relative 'matches_constraint_type'
10
+ require_relative 'remarks_type'
9
11
 
10
12
  module Metaschema
11
13
  class Flag < Lutaml::Model::Serializable
@@ -18,16 +20,16 @@ module Metaschema
18
20
  attribute :remarks, RemarksType
19
21
 
20
22
  xml do
21
- root "flag"
22
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
23
+ root 'flag'
24
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
23
25
 
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
26
+ map_attribute 'target', to: :target
27
+ map_element 'let', to: :let
28
+ map_element 'allowed-values', to: :allowed_values
29
+ map_element 'matches', to: :matches
30
+ map_element 'index-has-key', to: :index_has_key
31
+ map_element 'expect', to: :expect
32
+ map_element 'remarks', to: :remarks
31
33
  end
32
34
  end
33
35
  end
@@ -1,15 +1,17 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
2
 
3
- require_relative "markup_line_datatype"
4
- require_relative "property_type"
5
- require_relative "remarks_type"
6
- require_relative "use_name_type"
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 FlagReferenceType < Lutaml::Model::Serializable
10
12
  attribute :ref, :string
11
13
  attribute :index, :integer
12
- attribute :required, :string, default: -> { "no" }
14
+ attribute :required, :string, default: -> { 'no' }
13
15
  attribute :default, :string
14
16
  attribute :deprecated, :string
15
17
  attribute :formal_name, :string
@@ -19,19 +21,19 @@ module Metaschema
19
21
  attribute :remarks, RemarksType
20
22
 
21
23
  xml do
22
- root "FlagReferenceType"
23
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
24
+ root 'FlagReferenceType'
25
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
24
26
 
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
27
+ map_attribute 'ref', to: :ref
28
+ map_attribute 'index', to: :index
29
+ map_attribute 'required', to: :required
30
+ map_attribute 'default', to: :default
31
+ map_attribute 'deprecated', to: :deprecated
32
+ map_element 'formal-name', to: :formal_name
33
+ map_element 'description', to: :description
34
+ map_element 'prop', to: :prop
35
+ map_element 'use-name', to: :use_name
36
+ map_element 'remarks', to: :remarks
35
37
  end
36
38
  end
37
39
  end
@@ -1,22 +1,24 @@
1
- require "lutaml/model"
1
+ # frozen_string_literal: true
2
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"
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 'json_key_type'
11
+ require_relative 'markup_line_datatype'
12
+ require_relative 'property_type'
13
+ require_relative 'remarks_type'
14
+ require_relative 'root_name'
15
+ require_relative 'use_name_type'
14
16
 
15
17
  module Metaschema
16
18
  class GlobalAssemblyDefinitionType < Lutaml::Model::Serializable
17
19
  attribute :name, :string
18
20
  attribute :index, :integer
19
- attribute :scope, :string, default: -> { "global" }
21
+ attribute :scope, :string, default: -> { 'global' }
20
22
  attribute :deprecated, :string
21
23
  attribute :formal_name, :string
22
24
  attribute :description, MarkupLineDatatype
@@ -32,25 +34,25 @@ module Metaschema
32
34
  attribute :example, ExampleType, collection: true
33
35
 
34
36
  xml do
35
- root "GlobalAssemblyDefinitionType"
36
- namespace "http://csrc.nist.gov/ns/oscal/metaschema/1.0"
37
+ root 'GlobalAssemblyDefinitionType', ordered: true
38
+ namespace 'http://csrc.nist.gov/ns/oscal/metaschema/1.0'
37
39
 
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
40
+ map_attribute 'name', to: :name
41
+ map_attribute 'index', to: :index
42
+ map_attribute 'scope', to: :scope
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 'root-name', to: :root_name
48
+ map_element 'use-name', to: :use_name
49
+ map_element 'json-key', to: :json_key
50
+ map_element 'flag', to: :flag
51
+ map_element 'define-flag', to: :define_flag
52
+ map_element 'model', to: :model
53
+ map_element 'constraint', to: :constraint
54
+ map_element 'remarks', to: :remarks
55
+ map_element 'example', to: :example
54
56
  end
55
57
  end
56
58
  end