dry-schema 1.3.4 → 1.5.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/CHANGELOG.md +253 -101
- data/LICENSE +1 -1
- data/README.md +6 -6
- data/config/errors.yml +4 -0
- data/dry-schema.gemspec +46 -0
- data/lib/dry-schema.rb +1 -1
- data/lib/dry/schema.rb +20 -7
- data/lib/dry/schema/compiler.rb +4 -4
- data/lib/dry/schema/config.rb +15 -6
- data/lib/dry/schema/constants.rb +19 -9
- data/lib/dry/schema/dsl.rb +144 -38
- data/lib/dry/schema/extensions.rb +10 -2
- data/lib/dry/schema/extensions/hints.rb +15 -8
- data/lib/dry/schema/extensions/hints/message_compiler_methods.rb +2 -2
- data/lib/dry/schema/extensions/hints/message_set_methods.rb +0 -47
- data/lib/dry/schema/extensions/info.rb +27 -0
- data/lib/dry/schema/extensions/info/schema_compiler.rb +105 -0
- data/lib/dry/schema/extensions/monads.rb +1 -1
- data/lib/dry/schema/extensions/struct.rb +32 -0
- data/lib/dry/schema/json.rb +1 -1
- data/lib/dry/schema/key.rb +20 -5
- data/lib/dry/schema/key_coercer.rb +4 -4
- data/lib/dry/schema/key_map.rb +9 -4
- data/lib/dry/schema/key_validator.rb +66 -0
- data/lib/dry/schema/macros.rb +8 -8
- data/lib/dry/schema/macros/array.rb +17 -4
- data/lib/dry/schema/macros/core.rb +11 -6
- data/lib/dry/schema/macros/dsl.rb +53 -21
- data/lib/dry/schema/macros/each.rb +4 -4
- data/lib/dry/schema/macros/filled.rb +5 -6
- data/lib/dry/schema/macros/hash.rb +21 -3
- data/lib/dry/schema/macros/key.rb +10 -10
- data/lib/dry/schema/macros/maybe.rb +4 -5
- data/lib/dry/schema/macros/optional.rb +1 -1
- data/lib/dry/schema/macros/required.rb +1 -1
- data/lib/dry/schema/macros/schema.rb +23 -2
- data/lib/dry/schema/macros/value.rb +34 -7
- data/lib/dry/schema/message.rb +35 -9
- data/lib/dry/schema/message/or.rb +18 -39
- data/lib/dry/schema/message/or/abstract.rb +28 -0
- data/lib/dry/schema/message/or/multi_path.rb +37 -0
- data/lib/dry/schema/message/or/single_path.rb +64 -0
- data/lib/dry/schema/message_compiler.rb +40 -19
- data/lib/dry/schema/message_compiler/visitor_opts.rb +2 -2
- data/lib/dry/schema/message_set.rb +26 -37
- data/lib/dry/schema/messages.rb +6 -6
- data/lib/dry/schema/messages/abstract.rb +79 -66
- data/lib/dry/schema/messages/i18n.rb +36 -10
- data/lib/dry/schema/messages/namespaced.rb +13 -3
- data/lib/dry/schema/messages/template.rb +19 -44
- data/lib/dry/schema/messages/yaml.rb +72 -13
- data/lib/dry/schema/params.rb +1 -1
- data/lib/dry/schema/path.rb +44 -5
- data/lib/dry/schema/predicate.rb +2 -2
- data/lib/dry/schema/predicate_inferrer.rb +4 -184
- data/lib/dry/schema/predicate_registry.rb +3 -24
- data/lib/dry/schema/primitive_inferrer.rb +3 -86
- data/lib/dry/schema/processor.rb +54 -50
- data/lib/dry/schema/processor_steps.rb +139 -0
- data/lib/dry/schema/result.rb +52 -5
- data/lib/dry/schema/rule_applier.rb +8 -7
- data/lib/dry/schema/step.rb +79 -0
- data/lib/dry/schema/trace.rb +5 -4
- data/lib/dry/schema/type_container.rb +3 -3
- data/lib/dry/schema/type_registry.rb +2 -2
- data/lib/dry/schema/types.rb +1 -1
- data/lib/dry/schema/value_coercer.rb +2 -2
- data/lib/dry/schema/version.rb +1 -1
- metadata +21 -7
data/lib/dry/schema/macros.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
3
|
+
require "dry/schema/macros/array"
|
4
|
+
require "dry/schema/macros/each"
|
5
|
+
require "dry/schema/macros/filled"
|
6
|
+
require "dry/schema/macros/schema"
|
7
|
+
require "dry/schema/macros/hash"
|
8
|
+
require "dry/schema/macros/maybe"
|
9
|
+
require "dry/schema/macros/optional"
|
10
|
+
require "dry/schema/macros/required"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/schema/macros/dsl"
|
4
4
|
|
5
5
|
module Dry
|
6
6
|
module Schema
|
@@ -13,16 +13,29 @@ module Dry
|
|
13
13
|
def value(*args, **opts, &block)
|
14
14
|
type(:array)
|
15
15
|
|
16
|
-
extract_type_spec(*args, set_type: false) do |*predicates, type_spec:|
|
16
|
+
extract_type_spec(*args, set_type: false) do |*predicates, type_spec:, type_rule:|
|
17
17
|
type(schema_dsl.array[type_spec]) if type_spec
|
18
18
|
|
19
19
|
is_hash_block = type_spec.equal?(:hash)
|
20
20
|
|
21
21
|
if predicates.any? || opts.any? || !is_hash_block
|
22
|
-
super(
|
22
|
+
super(
|
23
|
+
*predicates, type_spec: type_spec, type_rule: type_rule, **opts,
|
24
|
+
&(is_hash_block ? nil : block)
|
25
|
+
)
|
23
26
|
end
|
24
27
|
|
25
|
-
|
28
|
+
is_op = args.size.equal?(2) && args[1].is_a?(Logic::Operations::Abstract)
|
29
|
+
|
30
|
+
if is_hash_block && !is_op
|
31
|
+
hash(&block)
|
32
|
+
elsif is_op
|
33
|
+
hash = Value.new(schema_dsl: schema_dsl.new, name: name).hash(args[1])
|
34
|
+
|
35
|
+
trace.captures.concat(hash.trace.captures)
|
36
|
+
|
37
|
+
type(schema_dsl.types[name].of(hash.schema_dsl.types[name]))
|
38
|
+
end
|
26
39
|
end
|
27
40
|
|
28
41
|
self
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/initializer"
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
5
|
+
require "dry/schema/constants"
|
6
|
+
require "dry/schema/compiler"
|
7
|
+
require "dry/schema/trace"
|
8
8
|
|
9
9
|
module Dry
|
10
10
|
module Schema
|
@@ -28,8 +28,13 @@ module Dry
|
|
28
28
|
option :schema_dsl, optional: true
|
29
29
|
|
30
30
|
# @api private
|
31
|
-
def new(options
|
32
|
-
self.class.new(
|
31
|
+
def new(**options)
|
32
|
+
self.class.new(name: name, compiler: compiler, schema_dsl: schema_dsl, **options)
|
33
|
+
end
|
34
|
+
|
35
|
+
# @api private
|
36
|
+
def path
|
37
|
+
schema_dsl.path
|
33
38
|
end
|
34
39
|
|
35
40
|
# @api private
|
@@ -1,8 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/logic/operators"
|
4
4
|
|
5
|
-
require
|
5
|
+
require "dry/schema/macros/core"
|
6
|
+
require "dry/schema/predicate_inferrer"
|
7
|
+
require "dry/schema/primitive_inferrer"
|
6
8
|
|
7
9
|
module Dry
|
8
10
|
module Schema
|
@@ -55,11 +57,12 @@ module Dry
|
|
55
57
|
# @return [Macros::Core]
|
56
58
|
#
|
57
59
|
# @api public
|
58
|
-
def value(*predicates,
|
60
|
+
def value(*predicates, &block)
|
59
61
|
append_macro(Macros::Value) do |macro|
|
60
|
-
macro.call(*predicates,
|
62
|
+
macro.call(*predicates, &block)
|
61
63
|
end
|
62
64
|
end
|
65
|
+
ruby2_keywords :value if respond_to?(:ruby2_keywords, true)
|
63
66
|
|
64
67
|
# Prepends `:filled?` predicate
|
65
68
|
#
|
@@ -72,11 +75,12 @@ module Dry
|
|
72
75
|
# @return [Macros::Core]
|
73
76
|
#
|
74
77
|
# @api public
|
75
|
-
def filled(*args,
|
78
|
+
def filled(*args, &block)
|
76
79
|
append_macro(Macros::Filled) do |macro|
|
77
|
-
macro.call(*args,
|
80
|
+
macro.call(*args, &block)
|
78
81
|
end
|
79
82
|
end
|
83
|
+
ruby2_keywords :filled if respond_to?(:ruby2_keywords, true)
|
80
84
|
|
81
85
|
# Specify a nested hash without enforced `hash?` type-check
|
82
86
|
#
|
@@ -97,6 +101,7 @@ module Dry
|
|
97
101
|
macro.call(*args, &block)
|
98
102
|
end
|
99
103
|
end
|
104
|
+
ruby2_keywords :schema if respond_to?(:ruby2_keywords, true)
|
100
105
|
|
101
106
|
# Specify a nested hash with enforced `hash?` type-check
|
102
107
|
#
|
@@ -111,6 +116,7 @@ module Dry
|
|
111
116
|
macro.call(*args, &block)
|
112
117
|
end
|
113
118
|
end
|
119
|
+
ruby2_keywords :hash if respond_to?(:ruby2_keywords, true)
|
114
120
|
|
115
121
|
# Specify predicates that should be applied to each element of an array
|
116
122
|
#
|
@@ -134,6 +140,7 @@ module Dry
|
|
134
140
|
macro.value(*args, &block)
|
135
141
|
end
|
136
142
|
end
|
143
|
+
ruby2_keywords :each if respond_to?(:ruby2_keywords, true)
|
137
144
|
|
138
145
|
# Like `each` but sets `array?` type-check
|
139
146
|
#
|
@@ -153,6 +160,7 @@ module Dry
|
|
153
160
|
macro.value(*args, &block)
|
154
161
|
end
|
155
162
|
end
|
163
|
+
ruby2_keywords :array if respond_to?(:ruby2_keywords, true)
|
156
164
|
|
157
165
|
# Set type spec
|
158
166
|
#
|
@@ -169,6 +177,11 @@ module Dry
|
|
169
177
|
self
|
170
178
|
end
|
171
179
|
|
180
|
+
# @api private
|
181
|
+
def custom_type?
|
182
|
+
schema_dsl.custom_type?(name)
|
183
|
+
end
|
184
|
+
|
172
185
|
private
|
173
186
|
|
174
187
|
# @api private
|
@@ -187,31 +200,50 @@ module Dry
|
|
187
200
|
|
188
201
|
# @api private
|
189
202
|
def extract_type_spec(*args, nullable: false, set_type: true)
|
190
|
-
type_spec = args[0]
|
191
|
-
|
192
|
-
is_type_spec = type_spec.is_a?(Dry::Schema::Processor) ||
|
193
|
-
type_spec.is_a?(Symbol) &&
|
194
|
-
type_spec.to_s.end_with?(QUESTION_MARK)
|
195
|
-
|
196
|
-
type_spec = nil if is_type_spec
|
203
|
+
type_spec = args[0] unless schema_or_predicate?(args[0])
|
197
204
|
|
198
205
|
predicates = Array(type_spec ? args[1..-1] : args)
|
206
|
+
type_rule = nil
|
199
207
|
|
200
208
|
if type_spec
|
201
|
-
resolved_type =
|
202
|
-
|
203
|
-
)
|
209
|
+
resolved_type = resolve_type(type_spec, nullable)
|
210
|
+
|
211
|
+
if type_spec.is_a?(::Array)
|
212
|
+
type_rule = type_spec.map { |ts| new(chain: false).value(ts) }.reduce(:|)
|
213
|
+
else
|
214
|
+
type_predicates = predicate_inferrer[resolved_type]
|
204
215
|
|
205
|
-
|
216
|
+
predicates.replace(type_predicates + predicates) unless type_predicates.empty?
|
206
217
|
|
207
|
-
|
218
|
+
return self if predicates.empty?
|
219
|
+
end
|
220
|
+
end
|
208
221
|
|
209
|
-
|
222
|
+
type(resolved_type) if set_type && resolved_type
|
210
223
|
|
211
|
-
|
224
|
+
if type_rule
|
225
|
+
yield(*predicates, type_spec: nil, type_rule: type_rule)
|
226
|
+
else
|
227
|
+
yield(*predicates, type_spec: type_spec, type_rule: nil)
|
212
228
|
end
|
229
|
+
end
|
230
|
+
|
231
|
+
# @api private
|
232
|
+
def resolve_type(type_spec, nullable)
|
233
|
+
resolved = schema_dsl.resolve_type(type_spec)
|
234
|
+
|
235
|
+
if type_spec.is_a?(::Array) || !nullable || resolved.optional?
|
236
|
+
resolved
|
237
|
+
else
|
238
|
+
schema_dsl.resolve_type([:nil, resolved])
|
239
|
+
end
|
240
|
+
end
|
213
241
|
|
214
|
-
|
242
|
+
# @api private
|
243
|
+
def schema_or_predicate?(arg)
|
244
|
+
arg.is_a?(Dry::Schema::Processor) ||
|
245
|
+
arg.is_a?(Symbol) &&
|
246
|
+
arg.to_s.end_with?(QUESTION_MARK)
|
215
247
|
end
|
216
248
|
end
|
217
249
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "dry/types/type"
|
4
|
+
require "dry/schema/macros/dsl"
|
5
5
|
|
6
6
|
module Dry
|
7
7
|
module Schema
|
@@ -12,12 +12,12 @@ module Dry
|
|
12
12
|
class Each < DSL
|
13
13
|
# @api private
|
14
14
|
def value(*args, **opts)
|
15
|
-
extract_type_spec(*args, set_type: false) do |*predicates, type_spec:|
|
15
|
+
extract_type_spec(*args, set_type: false) do |*predicates, type_spec:, type_rule:|
|
16
16
|
if type_spec && !type_spec.is_a?(Dry::Types::Type)
|
17
17
|
type(schema_dsl.array[type_spec])
|
18
18
|
end
|
19
19
|
|
20
|
-
super(*predicates, type_spec: type_spec, **opts)
|
20
|
+
super(*predicates, type_spec: type_spec, type_rule: type_rule, **opts)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require 'dry/schema/macros/value'
|
3
|
+
require "dry/schema/macros/value"
|
5
4
|
|
6
5
|
module Dry
|
7
6
|
module Schema
|
@@ -16,23 +15,23 @@ module Dry
|
|
16
15
|
|
17
16
|
if opts[:type_spec] && !filter_empty_string?
|
18
17
|
value(predicates[0], :filled?, *predicates[1..predicates.size - 1], **opts, &block)
|
18
|
+
elsif opts[:type_rule]
|
19
|
+
value(:filled?).value(*predicates, **opts, &block)
|
19
20
|
else
|
20
21
|
value(:filled?, *predicates, **opts, &block)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
25
|
# @api private
|
25
|
-
# rubocop:disable Style/GuardClause
|
26
26
|
def ensure_valid_predicates(predicates)
|
27
27
|
if predicates.include?(:empty?)
|
28
|
-
raise ::Dry::Schema::InvalidSchemaError,
|
28
|
+
raise ::Dry::Schema::InvalidSchemaError, "Using filled with empty? predicate is invalid"
|
29
29
|
end
|
30
30
|
|
31
31
|
if predicates.include?(:filled?)
|
32
|
-
raise ::Dry::Schema::InvalidSchemaError,
|
32
|
+
raise ::Dry::Schema::InvalidSchemaError, "Using filled with filled? is redundant"
|
33
33
|
end
|
34
34
|
end
|
35
|
-
# rubocop:enable Style/GuardClause
|
36
35
|
|
37
36
|
# @api private
|
38
37
|
def filter_empty_string?
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/schema/macros/schema"
|
4
4
|
|
5
5
|
module Dry
|
6
6
|
module Schema
|
@@ -11,8 +11,26 @@ module Dry
|
|
11
11
|
class Hash < Schema
|
12
12
|
# @api private
|
13
13
|
def call(*args, &block)
|
14
|
-
|
15
|
-
|
14
|
+
if args.size >= 1 && args[0].respond_to?(:keys)
|
15
|
+
hash_type = args[0]
|
16
|
+
type_predicates = predicate_inferrer[hash_type]
|
17
|
+
all_predicats = type_predicates + args.drop(1)
|
18
|
+
|
19
|
+
super(*all_predicats) do
|
20
|
+
hash_type.each do |key|
|
21
|
+
if key.required?
|
22
|
+
required(key.name).value(key.type)
|
23
|
+
else
|
24
|
+
optional(key.name).value(key.type)
|
25
|
+
end
|
26
|
+
instance_exec(&block) if block
|
27
|
+
end
|
28
|
+
end
|
29
|
+
else
|
30
|
+
trace << hash?
|
31
|
+
|
32
|
+
super(*args, &block)
|
33
|
+
end
|
16
34
|
end
|
17
35
|
end
|
18
36
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require 'dry/schema/constants'
|
3
|
+
require "dry/schema/processor"
|
4
|
+
require "dry/schema/macros/dsl"
|
5
|
+
require "dry/schema/constants"
|
7
6
|
|
8
7
|
module Dry
|
9
8
|
module Schema
|
@@ -31,6 +30,7 @@ module Dry
|
|
31
30
|
(filter_schema_dsl[name] || filter_schema_dsl.optional(name)).value(*args, &block)
|
32
31
|
self
|
33
32
|
end
|
33
|
+
ruby2_keywords(:filter) if respond_to?(:ruby2_keywords, true)
|
34
34
|
|
35
35
|
# @overload value(type_spec, *predicates, **predicate_opts)
|
36
36
|
# Set type specification and predicates
|
@@ -54,8 +54,8 @@ module Dry
|
|
54
54
|
#
|
55
55
|
# @api public
|
56
56
|
def value(*args, **opts, &block)
|
57
|
-
extract_type_spec(*args) do |*predicates, type_spec:|
|
58
|
-
super(*predicates, type_spec: type_spec, **opts, &block)
|
57
|
+
extract_type_spec(*args) do |*predicates, type_spec:, type_rule:|
|
58
|
+
super(*predicates, type_spec: type_spec, type_rule: type_rule, **opts, &block)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -70,8 +70,8 @@ module Dry
|
|
70
70
|
#
|
71
71
|
# @api public
|
72
72
|
def filled(*args, **opts, &block)
|
73
|
-
extract_type_spec(*args) do |*predicates, type_spec:|
|
74
|
-
super(*predicates, type_spec: type_spec, **opts, &block)
|
73
|
+
extract_type_spec(*args) do |*predicates, type_spec:, type_rule:|
|
74
|
+
super(*predicates, type_spec: type_spec, type_rule: type_rule, **opts, &block)
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -86,9 +86,9 @@ module Dry
|
|
86
86
|
#
|
87
87
|
# @api public
|
88
88
|
def maybe(*args, **opts, &block)
|
89
|
-
extract_type_spec(*args, nullable: true) do |*predicates, type_spec:|
|
89
|
+
extract_type_spec(*args, nullable: true) do |*predicates, type_spec:, type_rule:|
|
90
90
|
append_macro(Macros::Maybe) do |macro|
|
91
|
-
macro.call(*predicates, **opts, &block)
|
91
|
+
macro.call(*predicates, type_spec: type_spec, type_rule: type_rule, **opts, &block)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/schema/macros/dsl"
|
4
4
|
|
5
5
|
module Dry
|
6
6
|
module Schema
|
@@ -12,11 +12,11 @@ module Dry
|
|
12
12
|
# @api private
|
13
13
|
def call(*args, **opts, &block)
|
14
14
|
if args.include?(:empty?)
|
15
|
-
raise ::Dry::Schema::InvalidSchemaError,
|
15
|
+
raise ::Dry::Schema::InvalidSchemaError, "Using maybe with empty? predicate is invalid"
|
16
16
|
end
|
17
17
|
|
18
18
|
if args.include?(:nil?)
|
19
|
-
raise ::Dry::Schema::InvalidSchemaError,
|
19
|
+
raise ::Dry::Schema::InvalidSchemaError, "Using maybe with nil? predicate is redundant"
|
20
20
|
end
|
21
21
|
|
22
22
|
value(*args, **opts, &block)
|
@@ -30,8 +30,7 @@ module Dry
|
|
30
30
|
[
|
31
31
|
[:not, [:predicate, [:nil?, [[:input, Undefined]]]]],
|
32
32
|
trace.to_rule.to_ast
|
33
|
-
]
|
34
|
-
]
|
33
|
+
]]
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/schema/macros/value"
|
4
4
|
|
5
5
|
module Dry
|
6
6
|
module Schema
|
@@ -13,8 +13,13 @@ module Dry
|
|
13
13
|
def call(*args, &block)
|
14
14
|
super(*args, &nil) unless args.empty?
|
15
15
|
|
16
|
+
if args.size.equal?(1) && (op = args.first).is_a?(Dry::Logic::Operations::Abstract)
|
17
|
+
process_operation(op)
|
18
|
+
end
|
19
|
+
|
16
20
|
if block
|
17
21
|
schema = define(*args, &block)
|
22
|
+
import_steps(schema)
|
18
23
|
trace << schema.to_rule
|
19
24
|
end
|
20
25
|
|
@@ -23,9 +28,25 @@ module Dry
|
|
23
28
|
|
24
29
|
private
|
25
30
|
|
31
|
+
# @api private
|
32
|
+
def process_operation(op)
|
33
|
+
schemas = op.rules.select { |rule| rule.is_a?(Processor) }
|
34
|
+
|
35
|
+
hash_schema = hash_type.schema(
|
36
|
+
schemas.map(&:schema_dsl).map(&:types).reduce(:merge)
|
37
|
+
)
|
38
|
+
|
39
|
+
type(hash_schema)
|
40
|
+
end
|
41
|
+
|
42
|
+
# @api private
|
43
|
+
def hash_type
|
44
|
+
schema_dsl.resolve_type(:hash)
|
45
|
+
end
|
46
|
+
|
26
47
|
# @api private
|
27
48
|
def define(*args, &block)
|
28
|
-
definition = schema_dsl.new(&block)
|
49
|
+
definition = schema_dsl.new(path: schema_dsl.path, &block)
|
29
50
|
schema = definition.call
|
30
51
|
type_schema =
|
31
52
|
if array_type?(parent_type)
|