-
Notifications
You must be signed in to change notification settings - Fork 4
JSON Schema Examples
Ravi Kiran Pagidi edited this page Jun 28, 2026
·
1 revision
Planned. generate_from_schema does not currently parse JSON Schema objects or files.
JSON Schema describes API payloads and data contracts using properties, types, formats, required fields, ranges, and enumerations. It is valuable for API, event, and contract-testing teams.
# Planned, not runnable today
schema = {
"type": "object",
"properties": {
"customer_id": {"type": "string"},
"customer_name": {"type": "string"},
"age": {"type": "integer", "minimum": 18, "maximum": 85},
"email": {"type": "string", "format": "email"},
"status": {"type": "string", "enum": ["Active", "Inactive"]},
},
}
# Future shape
df = generate_from_schema(schema, rows=1000){"customer_id":"CUST000001","customer_name":"Ava Johnson","age":34,"email":"ava.johnson@example.com","status":"Active"}from great_generator import generate_from_schema
types = {
"customer_id": "string",
"customer_name": "string",
"age": "int",
"email": "string",
"status": "string",
}
rules = {
"age": {"min": 18, "max": 85},
"status": {"values": ["Active", "Inactive"]},
}
df = generate_from_schema(types, rows=1000, custom_rules=rules)
df.to_json("customers.json", orient="records", lines=True)JSON dataset recipe files are supported by generate_from_recipe; that does not mean JSON Schema is supported. Nested objects, arrays, $ref, composition, and format validation remain roadmap work.