class Apicraft::Mocker::String

Generate fake values for string data types

def enum

def enum
  schema.enum || []
end

def format

def format
  schema.format
end

def max_length

def max_length
  schema.maxLength
end

def min_length

def min_length
  schema.minLength
end

def mock

def mock
  return enum.sample if enum.present?
  return Faker::Internet.email if format == "email"
  return Faker::Internet.url if format == "uri"
  return Faker::Internet.uuid if format == "uuid"
  return Faker::Time.backward.iso8601 if format == "date-time"
  Faker::Lorem.word
end

def pattern

def pattern
  schema.pattern
end