diff --git a/base/schema-ruby/test/inputs/schema/minmaxlength.schema/default/TopLevel.rb b/head/schema-ruby/test/inputs/schema/minmaxlength.schema/default/TopLevel.rb
index 41773df..0355ec6 100644
--- a/base/schema-ruby/test/inputs/schema/minmaxlength.schema/default/TopLevel.rb
+++ b/head/schema-ruby/test/inputs/schema/minmaxlength.schema/default/TopLevel.rb
@@ -22,7 +22,7 @@ end
 
 class InUnion < Dry::Struct
   attribute :double, Types::Double.optional
-  attribute :string, Types::String.optional
+  attribute :string, Types::String.constrained(min_size: 3, max_size: 5).optional
 
   def self.from_dynamic!(d)
     if schema.key(:double).type.right.valid? d
@@ -52,14 +52,14 @@ class InUnion < Dry::Struct
 end
 
 class TopLevel < Dry::Struct
-  attribute :intersection,         Types::String
+  attribute :intersection,         Types::String.constrained(min_size: 4, max_size: 5)
   attribute :in_union,             Types.Instance(InUnion)
-  attribute :maxlength,            Types::String
-  attribute :minlength,            Types::String
-  attribute :min_max_intersection, Types::String
-  attribute :minmaxlength,         Types::String
+  attribute :maxlength,            Types::String.constrained(max_size: 5)
+  attribute :minlength,            Types::String.constrained(min_size: 3)
+  attribute :min_max_intersection, Types::String.constrained(min_size: 3, max_size: 5)
+  attribute :minmaxlength,         Types::String.constrained(min_size: 3, max_size: 5)
   attribute :min_max_union,        Types::String
-  attribute :union,                Types::String
+  attribute :union,                Types::String.constrained(min_size: 3, max_size: 6)
 
   def self.from_dynamic!(d)
     d = Types::Hash[d]
diff --git a/base/schema-ruby/test/inputs/schema/optional-const-ref.schema/default/TopLevel.rb b/head/schema-ruby/test/inputs/schema/optional-const-ref.schema/default/TopLevel.rb
index ee15103..76d6180 100644
--- a/base/schema-ruby/test/inputs/schema/optional-const-ref.schema/default/TopLevel.rb
+++ b/head/schema-ruby/test/inputs/schema/optional-const-ref.schema/default/TopLevel.rb
@@ -52,10 +52,10 @@ end
 class TopLevel < Dry::Struct
   attribute :coordinates,          Types.Array(Coordinate).optional
   attribute :count,                Types::Integer.optional
-  attribute :label,                Types::String.optional
+  attribute :label,                Types::String.constrained(min_size: 2, max_size: 16).optional
   attribute :required_coordinates, Types.Array(Coordinate)
   attribute :required_count,       Types::Integer
-  attribute :required_label,       Types::String
+  attribute :required_label,       Types::String.constrained(min_size: 2, max_size: 16)
   attribute :weight,               Types::Double.optional
 
   def self.from_dynamic!(d)
diff --git a/base/schema-ruby/test/inputs/schema/optional-constraints.schema/default/TopLevel.rb b/head/schema-ruby/test/inputs/schema/optional-constraints.schema/default/TopLevel.rb
index 4debbb4..c1f499d 100644
--- a/base/schema-ruby/test/inputs/schema/optional-constraints.schema/default/TopLevel.rb
+++ b/head/schema-ruby/test/inputs/schema/optional-constraints.schema/default/TopLevel.rb
@@ -25,7 +25,7 @@ class TopLevel < Dry::Struct
   attribute :opt_double,   Types::Double.optional
   attribute :opt_int,      Types::Integer.optional
   attribute :opt_pattern,  Types::String.optional
-  attribute :opt_string,   Types::String.optional
+  attribute :opt_string,   Types::String.constrained(min_size: 3, max_size: 10).optional
   attribute :req_zero_min, Types::Integer
 
   def self.from_dynamic!(d)
diff --git a/base/schema-ruby/test/inputs/schema/renaming-bug.schema/default/TopLevel.rb b/head/schema-ruby/test/inputs/schema/renaming-bug.schema/default/TopLevel.rb
index e557b88..d5ad332 100644
--- a/base/schema-ruby/test/inputs/schema/renaming-bug.schema/default/TopLevel.rb
+++ b/head/schema-ruby/test/inputs/schema/renaming-bug.schema/default/TopLevel.rb
@@ -212,7 +212,7 @@ end
 
 class Berry < Dry::Struct
   attribute :color,      Color.optional
-  attribute :berry_name, Types::String.optional
+  attribute :berry_name, Types::String.constrained(min_size: 1).optional
   attribute :shapes,     Types.Array(Shape).optional
 
   def self.from_dynamic!(d)
@@ -379,7 +379,7 @@ end
 
 class Vehicle < Dry::Struct
   attribute :brand,        Types::String.optional
-  attribute :id,           Types::String.optional
+  attribute :id,           Types::String.constrained(min_size: 1).optional
   attribute :speed,        Speed.optional
   attribute :sub_module,   Types::Bool.optional
   attribute :vehicle_type, VehicleType.optional
diff --git a/base/schema-ruby/test/inputs/schema/schema-constraints.schema/default/TopLevel.rb b/head/schema-ruby/test/inputs/schema/schema-constraints.schema/default/TopLevel.rb
index e26c00b..6a1e920 100644
--- a/base/schema-ruby/test/inputs/schema/schema-constraints.schema/default/TopLevel.rb
+++ b/head/schema-ruby/test/inputs/schema/schema-constraints.schema/default/TopLevel.rb
@@ -21,7 +21,7 @@ module Types
 end
 
 class TopLevel < Dry::Struct
-  attribute :min_max_length, Types::String
+  attribute :min_max_length, Types::String.constrained(min_size: 5, max_size: 5)
   attribute :percent,        Types::Double
 
   def self.from_dynamic!(d)
