MockHero

enum

Logic

Pick random values from a custom list with optional probability weights. The most flexible field type — define your own values and control their distribution.

Example Outputs

activependingcancelled

Parameters

ParameterDescription
valuesArray of possible values (required)
weightsProbability weights array

API Usage

Send a POST request to generate enum data:

curl -X POST https://mockhero.dev/api/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "tables": [
    {
      "name": "example",
      "count": 5,
      "fields": [
        {
          "name": "enum",
          "type": "enum",
          "params": {
            "values": [
              "active",
              "inactive",
              "pending"
            ]
          }
        }
      ]
    }
  ]
}'

Common Use Cases

  • Status field testing
  • Custom dropdown seeding
  • Categorical data generation
  • Weighted random selection

Quick Info

Field Type
enum
Category
Logic
Parameters
2 parameters
Output Format
JSON, CSV, SQL

Try it now

Generate enum data instantly in the playground.

Related Types

Generate Enum + 155 more types via API

One API call. Multiple tables. Relational integrity. Free tier included.

Get Started Free