class EasyTalk::Property
def build_nilable_schema
def build_nilable_schema # Extract the non-nil type from the Union actual_type = type.types.find { |t| t != NilClass } # Create a property with the actual type non_nil_schema = Property.new(name, actual_type, constraints).build # Merge the types into an array non_nil_schema.merge( type: [non_nil_schema[:type], 'null'] ) end