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