Skip to content

Faker Integration

The generator supports Faker providers via the faker hint in arg.properties. This gives you access to hundreds of realistic data generators for names, emails, addresses, phone numbers, and more.

Faker is included as a core dependency -- no extra install needed.

Simple usage

Pass the Faker method name as a string:

{
  "name": "customerName",
  "type": "string",
  "arg.properties": { "faker": "name" }
}

Common methods

Method Example output
name "John Smith"
first_name "Sarah"
last_name "Williams"
email "j.doe@example.com"
phone_number "+1-555-123-4567"
address "123 Main St, Springfield"
city "Cape Town"
country "South Africa"
company "Acme Corp"
job "Software Engineer"
url "https://example.com"
iban "DE89370400440532013000"
credit_card_number "4111111111111111"
date_of_birth "1985-03-12"
text "Lorem ipsum..."
sentence "The quick brown fox."
uuid4 "a1b2c3d4-..."
currency_code "ZAR"
color_name "teal"
user_agent "Mozilla/5.0..."
ipv4 "192.168.1.1"
mac_address "00:1B:44:11:3A:B7"

See the full list at Faker Providers.

Advanced usage

Pass a dict with method, args, kwargs, and/or locale:

With arguments

{
  "name": "accountNumber",
  "type": "string",
  "arg.properties": {
    "faker": { "method": "bothify", "args": ["###-???-####"] }
  }
}

With keyword arguments

{
  "name": "age",
  "type": "int",
  "arg.properties": {
    "faker": { "method": "random_int", "kwargs": { "min": 18, "max": 85 } }
  }
}

With locale

Generate locale-specific data:

{
  "name": "customerName",
  "type": "string",
  "arg.properties": {
    "faker": { "method": "name", "locale": "af_ZA" }
  }
}
{
  "name": "japaneseAddress",
  "type": "string",
  "arg.properties": {
    "faker": { "method": "address", "locale": "ja_JP" }
  }
}

Combining with rules

Use Faker inside conditional rules:

"arg.properties": {
  "rules": [
    {
      "when": { "field": "country", "equals": "ZA" },
      "then": { "faker": { "method": "name", "locale": "af_ZA" } }
    },
    {
      "when": { "field": "country", "equals": "JP" },
      "then": { "faker": { "method": "name", "locale": "ja_JP" } }
    }
  ]
}

Seed behaviour

When using --seed, Faker output is also seeded via seed_instance(), making all generated values — including Faker fields — fully deterministic and reproducible across runs.