Response Object
All Shim endpoints return HTTP 200 with this structured envelope.RepairResponse
Fields
success (boolean)
true: Repair succeeded, userepairedobjectfalse: Unrecoverable error, checkmetadata.errors
repaired (any | null)
- The fixed JSON object
nullif repair failed- Type depends on input (object, array, primitive)
metadata (RepairMetadata)
- Detailed information about the repair
- See below for full schema
RepairMetadata
Fields
confidence (ConfidenceLevel)
"high": Only structural fixes (safe)"medium": Schema repairs or warnings"low": Ambiguous repairs, review carefully"n/a": Reserved (not currently emitted; perfect input returns"high")
was_repaired (boolean)
true: Shim made changesfalse: Input was already valid
output_valid_json (boolean)
true: Repaired output is valid JSONfalse: Repair failed, output is not valid JSON
syntax_repairs (RepairDetail[])
- Structural fixes: brackets, commas, markdown fences
- Always safe
schema_repairs (RepairDetail[])
- Type coercion, field validation
- Review these if confidence is
"medium"or"low"
repairs_applied (RepairDetail[])
- Combined list of all repairs
- Includes both syntax and schema repairs
warnings (Warning[])
- Non-critical issues
- Repair succeeded but review recommended
errors (RepairError[])
- Critical failures
- Repair failed if this is non-empty
RepairDetail
Fields
type (string)
- Repair type identifier
- Examples:
"closed_object_bracket","type_coercion","removed_extra_field"
confidence (ConfidenceLevel)
- Confidence level for this specific repair
"high","medium", or"low"
safe (boolean)
true: Safe to apply automaticallyfalse: Review recommended
original_value (any, optional)
- Original value before repair
- Only present for schema repairs
repaired_value (any, optional)
- Value after repair
- Only present for schema repairs
field (string, optional)
- Field name that was repaired
- Only present for schema repairs
Warning
Fields
code (string)
- Warning code identifier
- Example:
"EXTRA_FIELD_REMOVED"
message (string)
- Human-readable warning message
field (string, optional)
- Field that triggered warning
severity (‘low’ | ‘medium’ | ‘high’)
- Warning severity level
suggestion (string, optional)
- How to address the warning
RepairError
Fields
code (string)
- Error code identifier
- See Error Codes
message (string)
- Human-readable error message
field (string, optional)
- Field that caused error
severity (‘critical’ | ‘high’ | ‘medium’)
- Error severity level
recoverable (boolean)
true: Can retryfalse: Unrecoverable, log and alert
suggestion (string, optional)
- How to fix the error
Example Responses
Successful Repair
Failed Repair
With Warnings
Next Steps
Batch Endpoint
API reference for batch repair
Streaming Endpoints
API reference for streaming repair
Error Codes
Complete error reference
TypeScript SDK
Use the official SDK
