Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
5test cases
5files differ
5modified
0new
0deleted
26changed lines
+13 −13insertions / deletions
Base 7cc8d8a58955a00fa24b69cb53f71f3a32fc4f5e · PR merge ad06dd39e4b2cabeb51679dce156ceffcd7d0cdf · Head 84d53f6d2b4805a2cf0306f67a6d70584b72966a · raw patch
Test case

test/inputs/schema/minmaxlength.schema

1 generated file · +7 −7
Mschema-rubydefault / TopLevel.rb+7 −7
@@ -22,7 +22,7 @@ end
2222
2323 class InUnion < Dry::Struct
2424 attribute :double, Types::Double.optional
25- attribute :string, Types::String.optional
25+ attribute :string, Types::String.constrained(min_size: 3, max_size: 5).optional
2626
2727 def self.from_dynamic!(d)
2828 if schema.key(:double).type.right.valid? d
@@ -52,14 +52,14 @@ class InUnion < Dry::Struct
5252 end
5353
5454 class TopLevel < Dry::Struct
55- attribute :intersection, Types::String
55+ attribute :intersection, Types::String.constrained(min_size: 4, max_size: 5)
5656 attribute :in_union, Types.Instance(InUnion)
57- attribute :maxlength, Types::String
58- attribute :minlength, Types::String
59- attribute :min_max_intersection, Types::String
60- attribute :minmaxlength, Types::String
57+ attribute :maxlength, Types::String.constrained(max_size: 5)
58+ attribute :minlength, Types::String.constrained(min_size: 3)
59+ attribute :min_max_intersection, Types::String.constrained(min_size: 3, max_size: 5)
60+ attribute :minmaxlength, Types::String.constrained(min_size: 3, max_size: 5)
6161 attribute :min_max_union, Types::String
62- attribute :union, Types::String
62+ attribute :union, Types::String.constrained(min_size: 3, max_size: 6)
6363
6464 def self.from_dynamic!(d)
6565 d = Types::Hash[d]
Test case

test/inputs/schema/optional-const-ref.schema

1 generated file · +2 −2
Mschema-rubydefault / TopLevel.rb+2 −2
@@ -52,10 +52,10 @@ end
5252 class TopLevel < Dry::Struct
5353 attribute :coordinates, Types.Array(Coordinate).optional
5454 attribute :count, Types::Integer.optional
55- attribute :label, Types::String.optional
55+ attribute :label, Types::String.constrained(min_size: 2, max_size: 16).optional
5656 attribute :required_coordinates, Types.Array(Coordinate)
5757 attribute :required_count, Types::Integer
58- attribute :required_label, Types::String
58+ attribute :required_label, Types::String.constrained(min_size: 2, max_size: 16)
5959 attribute :weight, Types::Double.optional
6060
6161 def self.from_dynamic!(d)
Test case

test/inputs/schema/optional-constraints.schema

1 generated file · +1 −1
Mschema-rubydefault / TopLevel.rb+1 −1
@@ -25,7 +25,7 @@ class TopLevel < Dry::Struct
2525 attribute :opt_double, Types::Double.optional
2626 attribute :opt_int, Types::Integer.optional
2727 attribute :opt_pattern, Types::String.optional
28- attribute :opt_string, Types::String.optional
28+ attribute :opt_string, Types::String.constrained(min_size: 3, max_size: 10).optional
2929 attribute :req_zero_min, Types::Integer
3030
3131 def self.from_dynamic!(d)
Test case

test/inputs/schema/renaming-bug.schema

1 generated file · +2 −2
Mschema-rubydefault / TopLevel.rb+2 −2
@@ -212,7 +212,7 @@ end
212212
213213 class Berry < Dry::Struct
214214 attribute :color, Color.optional
215- attribute :berry_name, Types::String.optional
215+ attribute :berry_name, Types::String.constrained(min_size: 1).optional
216216 attribute :shapes, Types.Array(Shape).optional
217217
218218 def self.from_dynamic!(d)
@@ -379,7 +379,7 @@ end
379379
380380 class Vehicle < Dry::Struct
381381 attribute :brand, Types::String.optional
382- attribute :id, Types::String.optional
382+ attribute :id, Types::String.constrained(min_size: 1).optional
383383 attribute :speed, Speed.optional
384384 attribute :sub_module, Types::Bool.optional
385385 attribute :vehicle_type, VehicleType.optional
Test case

test/inputs/schema/schema-constraints.schema

1 generated file · +1 −1
Mschema-rubydefault / TopLevel.rb+1 −1
@@ -21,7 +21,7 @@ module Types
2121 end
2222
2323 class TopLevel < Dry::Struct
24- attribute :min_max_length, Types::String
24+ attribute :min_max_length, Types::String.constrained(min_size: 5, max_size: 5)
2525 attribute :percent, Types::Double
2626
2727 def self.from_dynamic!(d)
No generated files match these filters.