metaschema 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +19 -1
- data/.rubocop_todo.yml +60 -8
- data/CLAUDE.md +78 -0
- data/Rakefile +3 -3
- data/exe/metaschema +1 -2
- data/lib/metaschema/allowed_value_type.rb +17 -24
- data/lib/metaschema/allowed_values_type.rb +15 -22
- data/lib/metaschema/anchor_type.rb +14 -19
- data/lib/metaschema/any_type.rb +2 -4
- data/lib/metaschema/assembly.rb +18 -27
- data/lib/metaschema/assembly_model_type.rb +10 -19
- data/lib/metaschema/assembly_reference_type.rb +16 -24
- data/lib/metaschema/block_quote_type.rb +17 -25
- data/lib/metaschema/choice_type.rb +6 -13
- data/lib/metaschema/code_type.rb +16 -22
- data/lib/metaschema/constraint_let_type.rb +5 -9
- data/lib/metaschema/define_assembly_constraints_type.rb +17 -26
- data/lib/metaschema/define_field_constraints_type.rb +13 -19
- data/lib/metaschema/define_flag_constraints_type.rb +9 -17
- data/lib/metaschema/example_type.rb +6 -11
- data/lib/metaschema/expect_constraint_type.rb +12 -18
- data/lib/metaschema/field.rb +13 -20
- data/lib/metaschema/field_reference_type.rb +19 -27
- data/lib/metaschema/flag.rb +9 -18
- data/lib/metaschema/flag_reference_type.rb +14 -21
- data/lib/metaschema/formal_name.rb +9 -0
- data/lib/metaschema/global_assembly_definition_type.rb +21 -34
- data/lib/metaschema/global_field_definition_type.rb +26 -39
- data/lib/metaschema/global_flag_definition_type.rb +18 -27
- data/lib/metaschema/group_as_type.rb +7 -9
- data/lib/metaschema/grouped_assembly_reference_type.rb +11 -18
- data/lib/metaschema/grouped_choice_type.rb +16 -24
- data/lib/metaschema/grouped_field_reference_type.rb +11 -18
- data/lib/metaschema/grouped_inline_assembly_definition_type.rb +17 -29
- data/lib/metaschema/grouped_inline_field_definition_type.rb +26 -37
- data/lib/metaschema/image_type.rb +5 -7
- data/lib/metaschema/import.rb +3 -5
- data/lib/metaschema/index_has_key_constraint_type.rb +12 -19
- data/lib/metaschema/inline_assembly_definition_type.rb +25 -38
- data/lib/metaschema/inline_field_definition_type.rb +31 -43
- data/lib/metaschema/inline_flag_definition_type.rb +17 -25
- data/lib/metaschema/inline_markup_type.rb +16 -21
- data/lib/metaschema/insert_type.rb +4 -6
- data/lib/metaschema/json_base_uri.rb +9 -0
- data/lib/metaschema/json_key_type.rb +3 -5
- data/lib/metaschema/json_value_key.rb +9 -0
- data/lib/metaschema/json_value_key_flag_type.rb +3 -5
- data/lib/metaschema/key_field.rb +5 -9
- data/lib/metaschema/list_item_type.rb +28 -38
- data/lib/metaschema/list_type.rb +3 -7
- data/lib/metaschema/markup_line_datatype.rb +15 -22
- data/lib/metaschema/matches_constraint_type.rb +12 -18
- data/lib/metaschema/metaschema_constraints.rb +24 -0
- data/lib/metaschema/metaschema_import_type.rb +3 -5
- data/lib/metaschema/namespace.rb +8 -0
- data/lib/metaschema/namespace_binding_type.rb +4 -6
- data/lib/metaschema/namespace_value.rb +9 -0
- data/lib/metaschema/ordered_list_type.rb +4 -8
- data/lib/metaschema/preformatted_type.rb +15 -22
- data/lib/metaschema/property_type.rb +6 -8
- data/lib/metaschema/remarks_type.rb +18 -27
- data/lib/metaschema/root.rb +21 -31
- data/lib/metaschema/root_name.rb +3 -5
- data/lib/metaschema/schema_version.rb +9 -0
- data/lib/metaschema/scope.rb +7 -13
- data/lib/metaschema/short_name.rb +9 -0
- data/lib/metaschema/table_cell_type.rb +17 -24
- data/lib/metaschema/table_row_type.rb +4 -8
- data/lib/metaschema/table_type.rb +3 -7
- data/lib/metaschema/targeted_allowed_values_constraint_type.rb +16 -23
- data/lib/metaschema/targeted_expect_constraint_type.rb +13 -19
- data/lib/metaschema/targeted_has_cardinality_constraint_type.rb +13 -19
- data/lib/metaschema/targeted_index_constraint_type.rb +13 -20
- data/lib/metaschema/targeted_index_has_key_constraint_type.rb +13 -20
- data/lib/metaschema/targeted_key_constraint_type.rb +12 -19
- data/lib/metaschema/targeted_matches_constraint_type.rb +13 -19
- data/lib/metaschema/use_name_type.rb +3 -5
- data/lib/metaschema/version.rb +1 -1
- data/lib/metaschema.rb +89 -9
- metadata +20 -95
- data/lib/metaschema/metaschemaconstraints.rb +0 -31
data/lib/metaschema/code_type.rb
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
9
|
-
|
|
10
3
|
module Metaschema
|
|
11
4
|
class CodeType < Lutaml::Model::Serializable
|
|
12
5
|
attribute :content, :string
|
|
@@ -25,23 +18,24 @@ module Metaschema
|
|
|
25
18
|
attribute :img, ImageType, collection: true
|
|
26
19
|
|
|
27
20
|
xml do
|
|
28
|
-
|
|
29
|
-
namespace
|
|
21
|
+
element "codeType"
|
|
22
|
+
namespace ::Metaschema::Namespace
|
|
23
|
+
mixed_content
|
|
30
24
|
|
|
31
25
|
map_content to: :content
|
|
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
|
|
26
|
+
map_attribute "class", to: :klass
|
|
27
|
+
map_element "a", to: :a
|
|
28
|
+
map_element "insert", to: :insert
|
|
29
|
+
map_element "br", to: :br
|
|
30
|
+
map_element "code", to: :code
|
|
31
|
+
map_element "em", to: :em
|
|
32
|
+
map_element "i", to: :i
|
|
33
|
+
map_element "b", to: :b
|
|
34
|
+
map_element "strong", to: :strong
|
|
35
|
+
map_element "sub", to: :sub
|
|
36
|
+
map_element "sup", to: :sup
|
|
37
|
+
map_element "q", to: :q
|
|
38
|
+
map_element "img", to: :img
|
|
45
39
|
end
|
|
46
40
|
end
|
|
47
41
|
end
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'lutaml/model'
|
|
4
|
-
|
|
5
|
-
require_relative 'remarks_type'
|
|
6
|
-
|
|
7
3
|
module Metaschema
|
|
8
4
|
class ConstraintLetType < Lutaml::Model::Serializable
|
|
9
5
|
attribute :var, :string
|
|
@@ -11,12 +7,12 @@ module Metaschema
|
|
|
11
7
|
attribute :remarks, RemarksType
|
|
12
8
|
|
|
13
9
|
xml do
|
|
14
|
-
|
|
15
|
-
namespace
|
|
10
|
+
element "ConstraintLetType"
|
|
11
|
+
namespace ::Metaschema::Namespace
|
|
16
12
|
|
|
17
|
-
map_attribute
|
|
18
|
-
map_attribute
|
|
19
|
-
map_element
|
|
13
|
+
map_attribute "var", to: :var
|
|
14
|
+
map_attribute "expression", to: :expression
|
|
15
|
+
map_element "remarks", to: :remarks
|
|
20
16
|
end
|
|
21
17
|
end
|
|
22
18
|
end
|
|
@@ -1,42 +1,33 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
14
|
-
|
|
15
3
|
module Metaschema
|
|
16
4
|
class DefineAssemblyConstraintsType < Lutaml::Model::Serializable
|
|
17
5
|
attribute :let, ConstraintLetType, collection: true
|
|
18
|
-
attribute :allowed_values, TargetedAllowedValuesConstraintType,
|
|
6
|
+
attribute :allowed_values, TargetedAllowedValuesConstraintType,
|
|
7
|
+
collection: true
|
|
19
8
|
attribute :matches, TargetedMatchesConstraintType, collection: true
|
|
20
|
-
attribute :index_has_key, TargetedIndexHasKeyConstraintType,
|
|
9
|
+
attribute :index_has_key, TargetedIndexHasKeyConstraintType,
|
|
10
|
+
collection: true
|
|
21
11
|
attribute :expect, TargetedExpectConstraintType, collection: true
|
|
22
12
|
attribute :index, TargetedIndexConstraintType, collection: true
|
|
23
13
|
attribute :is_unique, TargetedKeyConstraintType, collection: true
|
|
24
|
-
attribute :has_cardinality, TargetedHasCardinalityConstraintType,
|
|
14
|
+
attribute :has_cardinality, TargetedHasCardinalityConstraintType,
|
|
15
|
+
collection: true
|
|
25
16
|
attribute :remarks, RemarksType
|
|
26
17
|
|
|
27
18
|
xml do
|
|
28
|
-
|
|
29
|
-
namespace
|
|
19
|
+
element "DefineAssemblyConstraintsType"
|
|
20
|
+
namespace ::Metaschema::Namespace
|
|
30
21
|
|
|
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
|
|
22
|
+
map_element "let", to: :let
|
|
23
|
+
map_element "is-unique", to: :is_unique
|
|
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 "index", to: :index
|
|
29
|
+
map_element "has-cardinality", to: :has_cardinality
|
|
30
|
+
map_element "remarks", to: :remarks
|
|
40
31
|
end
|
|
41
32
|
end
|
|
42
33
|
end
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
11
|
-
|
|
12
3
|
module Metaschema
|
|
13
4
|
class DefineFieldConstraintsType < Lutaml::Model::Serializable
|
|
14
5
|
attribute :let, ConstraintLetType, collection: true
|
|
15
|
-
attribute :allowed_values, TargetedAllowedValuesConstraintType,
|
|
6
|
+
attribute :allowed_values, TargetedAllowedValuesConstraintType,
|
|
7
|
+
collection: true
|
|
16
8
|
attribute :matches, TargetedMatchesConstraintType, collection: true
|
|
17
|
-
attribute :index_has_key, TargetedIndexHasKeyConstraintType,
|
|
9
|
+
attribute :index_has_key, TargetedIndexHasKeyConstraintType,
|
|
10
|
+
collection: true
|
|
18
11
|
attribute :expect, TargetedExpectConstraintType, collection: true
|
|
19
12
|
attribute :remarks, RemarksType
|
|
20
13
|
|
|
21
14
|
xml do
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
element "DefineFieldConstraintsType"
|
|
16
|
+
mixed_content
|
|
17
|
+
namespace ::Metaschema::Namespace
|
|
24
18
|
|
|
25
|
-
map_element
|
|
26
|
-
map_element
|
|
27
|
-
map_element
|
|
28
|
-
map_element
|
|
29
|
-
map_element
|
|
30
|
-
map_element
|
|
19
|
+
map_element "let", to: :let
|
|
20
|
+
map_element "allowed-values", to: :allowed_values
|
|
21
|
+
map_element "matches", to: :matches
|
|
22
|
+
map_element "index-has-key", to: :index_has_key
|
|
23
|
+
map_element "expect", to: :expect
|
|
24
|
+
map_element "remarks", to: :remarks
|
|
31
25
|
end
|
|
32
26
|
end
|
|
33
27
|
end
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
11
|
-
|
|
12
3
|
module Metaschema
|
|
13
4
|
class DefineFlagConstraintsType < Lutaml::Model::Serializable
|
|
14
5
|
attribute :let, ConstraintLetType, collection: true
|
|
@@ -19,15 +10,16 @@ module Metaschema
|
|
|
19
10
|
attribute :remarks, RemarksType
|
|
20
11
|
|
|
21
12
|
xml do
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
element "DefineFlagConstraintsType"
|
|
14
|
+
mixed_content
|
|
15
|
+
namespace ::Metaschema::Namespace
|
|
24
16
|
|
|
25
|
-
map_element
|
|
26
|
-
map_element
|
|
27
|
-
map_element
|
|
28
|
-
map_element
|
|
29
|
-
map_element
|
|
30
|
-
map_element
|
|
17
|
+
map_element "let", to: :let
|
|
18
|
+
map_element "allowed-values", to: :allowed_values
|
|
19
|
+
map_element "matches", to: :matches
|
|
20
|
+
map_element "index-has-key", to: :index_has_key
|
|
21
|
+
map_element "expect", to: :expect
|
|
22
|
+
map_element "remarks", to: :remarks
|
|
31
23
|
end
|
|
32
24
|
end
|
|
33
25
|
end
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'lutaml/model'
|
|
4
|
-
|
|
5
|
-
require_relative 'markup_line_datatype'
|
|
6
|
-
require_relative 'remarks_type'
|
|
7
|
-
|
|
8
3
|
module Metaschema
|
|
9
4
|
class ExampleType < Lutaml::Model::Serializable
|
|
10
5
|
attribute :href, :string
|
|
@@ -13,13 +8,13 @@ module Metaschema
|
|
|
13
8
|
attribute :remarks, RemarksType
|
|
14
9
|
|
|
15
10
|
xml do
|
|
16
|
-
|
|
17
|
-
namespace
|
|
11
|
+
element "ExampleType"
|
|
12
|
+
namespace ::Metaschema::Namespace
|
|
18
13
|
|
|
19
|
-
map_attribute
|
|
20
|
-
map_attribute
|
|
21
|
-
map_element
|
|
22
|
-
map_element
|
|
14
|
+
map_attribute "href", to: :href
|
|
15
|
+
map_attribute "path", to: :path
|
|
16
|
+
map_element "description", to: :description
|
|
17
|
+
map_element "remarks", to: :remarks
|
|
23
18
|
end
|
|
24
19
|
end
|
|
25
20
|
end
|
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'lutaml/model'
|
|
4
|
-
|
|
5
|
-
require_relative 'markup_line_datatype'
|
|
6
|
-
require_relative 'property_type'
|
|
7
|
-
require_relative 'remarks_type'
|
|
8
|
-
|
|
9
3
|
module Metaschema
|
|
10
4
|
class ExpectConstraintType < Lutaml::Model::Serializable
|
|
11
5
|
attribute :id, :string
|
|
12
|
-
attribute :level, :string, default: -> {
|
|
6
|
+
attribute :level, :string, default: -> { "ERROR" }
|
|
13
7
|
attribute :test, :string
|
|
14
|
-
attribute :formal_name,
|
|
8
|
+
attribute :formal_name, FormalName
|
|
15
9
|
attribute :description, MarkupLineDatatype
|
|
16
10
|
attribute :prop, PropertyType, collection: true
|
|
17
11
|
attribute :message, :string
|
|
18
12
|
attribute :remarks, RemarksType
|
|
19
13
|
|
|
20
14
|
xml do
|
|
21
|
-
|
|
22
|
-
namespace
|
|
15
|
+
element "ExpectConstraintType"
|
|
16
|
+
namespace ::Metaschema::Namespace
|
|
23
17
|
|
|
24
|
-
map_attribute
|
|
25
|
-
map_attribute
|
|
26
|
-
map_attribute
|
|
27
|
-
map_element
|
|
28
|
-
map_element
|
|
29
|
-
map_element
|
|
30
|
-
map_element
|
|
31
|
-
map_element
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "level", to: :level
|
|
20
|
+
map_attribute "test", to: :test
|
|
21
|
+
map_element "formal-name", to: :formal_name
|
|
22
|
+
map_element "description", to: :description
|
|
23
|
+
map_element "prop", to: :prop
|
|
24
|
+
map_element "message", to: :message
|
|
25
|
+
map_element "remarks", to: :remarks
|
|
32
26
|
end
|
|
33
27
|
end
|
|
34
28
|
end
|
data/lib/metaschema/field.rb
CHANGED
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
11
|
-
|
|
12
3
|
module Metaschema
|
|
13
4
|
class Field < Lutaml::Model::Serializable
|
|
14
5
|
attribute :target, :string
|
|
15
6
|
attribute :let, ConstraintLetType, collection: true
|
|
16
|
-
attribute :allowed_values, TargetedAllowedValuesConstraintType,
|
|
7
|
+
attribute :allowed_values, TargetedAllowedValuesConstraintType,
|
|
8
|
+
collection: true
|
|
17
9
|
attribute :matches, TargetedMatchesConstraintType, collection: true
|
|
18
|
-
attribute :index_has_key, TargetedIndexHasKeyConstraintType,
|
|
10
|
+
attribute :index_has_key, TargetedIndexHasKeyConstraintType,
|
|
11
|
+
collection: true
|
|
19
12
|
attribute :expect, TargetedExpectConstraintType, collection: true
|
|
20
13
|
attribute :remarks, RemarksType
|
|
21
14
|
|
|
22
15
|
xml do
|
|
23
|
-
|
|
24
|
-
namespace
|
|
16
|
+
element "field"
|
|
17
|
+
namespace ::Metaschema::Namespace
|
|
25
18
|
|
|
26
|
-
map_attribute
|
|
27
|
-
map_element
|
|
28
|
-
map_element
|
|
29
|
-
map_element
|
|
30
|
-
map_element
|
|
31
|
-
map_element
|
|
32
|
-
map_element
|
|
19
|
+
map_attribute "target", to: :target
|
|
20
|
+
map_element "let", to: :let
|
|
21
|
+
map_element "allowed-values", to: :allowed_values
|
|
22
|
+
map_element "matches", to: :matches
|
|
23
|
+
map_element "index-has-key", to: :index_has_key
|
|
24
|
+
map_element "expect", to: :expect
|
|
25
|
+
map_element "remarks", to: :remarks
|
|
33
26
|
end
|
|
34
27
|
end
|
|
35
28
|
end
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
10
|
-
|
|
11
3
|
module Metaschema
|
|
12
4
|
class FieldReferenceType < Lutaml::Model::Serializable
|
|
13
5
|
attribute :ref, :string
|
|
14
6
|
attribute :index, :integer
|
|
15
|
-
attribute :min_occurs, :integer, default: -> {
|
|
16
|
-
attribute :max_occurs, :string, default: -> {
|
|
17
|
-
attribute :in_xml, :string, default: -> {
|
|
7
|
+
attribute :min_occurs, :integer, default: -> { "0" }
|
|
8
|
+
attribute :max_occurs, :string, default: -> { "1" }
|
|
9
|
+
attribute :in_xml, :string, default: -> { "WRAPPED" }
|
|
18
10
|
attribute :default, :string
|
|
19
11
|
attribute :deprecated, :string
|
|
20
|
-
attribute :formal_name,
|
|
12
|
+
attribute :formal_name, FormalName
|
|
21
13
|
attribute :description, MarkupLineDatatype
|
|
22
14
|
attribute :prop, PropertyType, collection: true
|
|
23
15
|
attribute :use_name, UseNameType
|
|
@@ -25,22 +17,22 @@ module Metaschema
|
|
|
25
17
|
attribute :remarks, RemarksType
|
|
26
18
|
|
|
27
19
|
xml do
|
|
28
|
-
|
|
29
|
-
namespace
|
|
20
|
+
element "FieldReferenceType"
|
|
21
|
+
namespace ::Metaschema::Namespace
|
|
30
22
|
|
|
31
|
-
map_attribute
|
|
32
|
-
map_attribute
|
|
33
|
-
map_attribute
|
|
34
|
-
map_attribute
|
|
35
|
-
map_attribute
|
|
36
|
-
map_attribute
|
|
37
|
-
map_attribute
|
|
38
|
-
map_element
|
|
39
|
-
map_element
|
|
40
|
-
map_element
|
|
41
|
-
map_element
|
|
42
|
-
map_element
|
|
43
|
-
map_element
|
|
23
|
+
map_attribute "ref", to: :ref
|
|
24
|
+
map_attribute "index", to: :index
|
|
25
|
+
map_attribute "min-occurs", to: :min_occurs
|
|
26
|
+
map_attribute "max-occurs", to: :max_occurs
|
|
27
|
+
map_attribute "in-xml", to: :in_xml
|
|
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 "group-as", to: :group_as
|
|
35
|
+
map_element "remarks", to: :remarks
|
|
44
36
|
end
|
|
45
37
|
end
|
|
46
38
|
end
|
data/lib/metaschema/flag.rb
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
11
|
-
|
|
12
3
|
module Metaschema
|
|
13
4
|
class Flag < Lutaml::Model::Serializable
|
|
14
5
|
attribute :target, :string
|
|
@@ -20,16 +11,16 @@ module Metaschema
|
|
|
20
11
|
attribute :remarks, RemarksType
|
|
21
12
|
|
|
22
13
|
xml do
|
|
23
|
-
|
|
24
|
-
namespace
|
|
14
|
+
element "flag"
|
|
15
|
+
namespace ::Metaschema::Namespace
|
|
25
16
|
|
|
26
|
-
map_attribute
|
|
27
|
-
map_element
|
|
28
|
-
map_element
|
|
29
|
-
map_element
|
|
30
|
-
map_element
|
|
31
|
-
map_element
|
|
32
|
-
map_element
|
|
17
|
+
map_attribute "target", to: :target
|
|
18
|
+
map_element "let", to: :let
|
|
19
|
+
map_element "allowed-values", to: :allowed_values
|
|
20
|
+
map_element "matches", to: :matches
|
|
21
|
+
map_element "index-has-key", to: :index_has_key
|
|
22
|
+
map_element "expect", to: :expect
|
|
23
|
+
map_element "remarks", to: :remarks
|
|
33
24
|
end
|
|
34
25
|
end
|
|
35
26
|
end
|
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
9
|
-
|
|
10
3
|
module Metaschema
|
|
11
4
|
class FlagReferenceType < Lutaml::Model::Serializable
|
|
12
5
|
attribute :ref, :string
|
|
13
6
|
attribute :index, :integer
|
|
14
|
-
attribute :required, :string, default: -> {
|
|
7
|
+
attribute :required, :string, default: -> { "no" }
|
|
15
8
|
attribute :default, :string
|
|
16
9
|
attribute :deprecated, :string
|
|
17
|
-
attribute :formal_name,
|
|
10
|
+
attribute :formal_name, FormalName
|
|
18
11
|
attribute :description, MarkupLineDatatype
|
|
19
12
|
attribute :prop, PropertyType, collection: true
|
|
20
13
|
attribute :use_name, UseNameType
|
|
21
14
|
attribute :remarks, RemarksType
|
|
22
15
|
|
|
23
16
|
xml do
|
|
24
|
-
|
|
25
|
-
namespace
|
|
17
|
+
element "FlagReferenceType"
|
|
18
|
+
namespace ::Metaschema::Namespace
|
|
26
19
|
|
|
27
|
-
map_attribute
|
|
28
|
-
map_attribute
|
|
29
|
-
map_attribute
|
|
30
|
-
map_attribute
|
|
31
|
-
map_attribute
|
|
32
|
-
map_element
|
|
33
|
-
map_element
|
|
34
|
-
map_element
|
|
35
|
-
map_element
|
|
36
|
-
map_element
|
|
20
|
+
map_attribute "ref", to: :ref
|
|
21
|
+
map_attribute "index", to: :index
|
|
22
|
+
map_attribute "required", to: :required
|
|
23
|
+
map_attribute "default", to: :default
|
|
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 "remarks", to: :remarks
|
|
37
30
|
end
|
|
38
31
|
end
|
|
39
32
|
end
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
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'
|
|
16
|
-
|
|
17
3
|
module Metaschema
|
|
18
4
|
class GlobalAssemblyDefinitionType < Lutaml::Model::Serializable
|
|
19
5
|
attribute :name, :string
|
|
20
6
|
attribute :index, :integer
|
|
21
|
-
attribute :scope, :string, default: -> {
|
|
7
|
+
attribute :scope, :string, default: -> { "global" }
|
|
22
8
|
attribute :deprecated, :string
|
|
23
|
-
attribute :formal_name,
|
|
9
|
+
attribute :formal_name, FormalName
|
|
24
10
|
attribute :description, MarkupLineDatatype
|
|
25
11
|
attribute :prop, PropertyType, collection: true
|
|
26
12
|
attribute :root_name, RootName
|
|
@@ -34,25 +20,26 @@ module Metaschema
|
|
|
34
20
|
attribute :example, ExampleType, collection: true
|
|
35
21
|
|
|
36
22
|
xml do
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
element "GlobalAssemblyDefinitionType"
|
|
24
|
+
ordered
|
|
25
|
+
namespace ::Metaschema::Namespace
|
|
39
26
|
|
|
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
|
|
27
|
+
map_attribute "name", to: :name
|
|
28
|
+
map_attribute "index", to: :index
|
|
29
|
+
map_attribute "scope", to: :scope
|
|
30
|
+
map_attribute "deprecated", to: :deprecated
|
|
31
|
+
map_element "formal-name", to: :formal_name
|
|
32
|
+
map_element "description", to: :description
|
|
33
|
+
map_element "prop", to: :prop
|
|
34
|
+
map_element "root-name", to: :root_name
|
|
35
|
+
map_element "use-name", to: :use_name
|
|
36
|
+
map_element "json-key", to: :json_key
|
|
37
|
+
map_element "flag", to: :flag
|
|
38
|
+
map_element "define-flag", to: :define_flag
|
|
39
|
+
map_element "model", to: :model
|
|
40
|
+
map_element "constraint", to: :constraint
|
|
41
|
+
map_element "remarks", to: :remarks
|
|
42
|
+
map_element "example", to: :example
|
|
56
43
|
end
|
|
57
44
|
end
|
|
58
45
|
end
|