enum
LogicPick 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
activependingcancelledParameters
| Parameter | Description |
|---|---|
| values | Array of possible values (required) |
| weights | Probability 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
Generate Enum + 155 more types via API
One API call. Multiple tables. Relational integrity. Free tier included.