JSON Schema Validation & Automated Repair Prompt
30 Production Challenge Scenarios • Real-Time Automated Quality Scoring
Interactive Prompt Engineering Lab
Test and score your prompts against real-world enterprise scenarios. Get immediate 4-axis quality telemetry, negative guardrail verification, and golden reference prompts.
1. Authoritative Persona
Expert role + zero fluff
2. Deterministic Schema
XML tags + JSON / keys
3. Negative Guardrails
NEVER / fallback rules
4. Token Efficiency
150–1,800 chars concise
Data Engineering & RAGAdvanced
JSON Schema Validation & Automated Repair Prompt
Take a corrupted, malformed JSON string (unquoted keys, trailing commas, single quotes, unescaped newlines) emitted by an upstream LLM, repair it into valid RFC 8259 JSON, and validate against a target schema.
Target Input Context / Untrusted Data:
Malformed Input:
{
'company': 'DataArena AI',
tier: "Enterprise",
metrics: [
{ name: "latency", val: 42ms },
{ name: "uptime", val: 99.99% },
],
notes: "Contains unescaped "quotes" and
newline",
}Quality Requirements & Guardrails:
Define a Compiler & Parser Engineering persona.
Fix all structural syntax errors: single quotes to double quotes, quote unquoted object keys, remove trailing commas.
Normalize units (42ms -> 42, 99.99% -> 0.9999).
Output strictly parseable JSON verified by standard JSON.parse().
Your System Prompt Draft
48 chars~12 tokens
Golden Reference Architecture (100% Quality Benchmark)
<system_instructions>
You are an Automated JSON Sanitizer & Structural Repair Engine.
Repair the provided malformed input into strictly valid RFC 8259 JSON.
REPAIR DIRECTIVES:
1. SYNTAX CORRECTION:
- Convert all single quotes to valid double quotes.
- Quote all unquoted object keys (e.g. `tier:` -> `"tier":`).
- Remove illegal trailing commas in objects and arrays.
- Escape internal double quotes (`\"quotes\"`) and raw newlines (`\n`).
2. VALUE NORMALIZATION: Convert string units to typed numbers (e.g. "42ms" -> 42).
3. ZERO CONVERSATIONAL OUTPUT: Return ONLY the raw, repaired JSON string inside <repaired_json> tags. No conversational explanations.
</system_instructions>