{"openapi":"3.0.3","info":{"title":"Broken JSON & LLM Output Healer API","version":"1.0.0","description":"Repairs malformed JSON and LLM outputs (markdown fences, trailing commas, single quotes, unquoted keys, comments, truncated strings/containers) and optionally validates against a JSON Schema."},"servers":[{"url":"https://api.tinplate.dev","description":"Production Edge Gateway"}],"components":{"schemas":{"JsonHealResponse":{"type":"object","properties":{"valid":{"type":"boolean","example":true},"data":{"nullable":true,"example":{"name":"Tinplate","tags":["api","edge"],"active":true}},"healed_json":{"type":"string","nullable":true,"example":"{\"name\":\"Tinplate\",\"tags\":[\"api\",\"edge\"],\"active\":true}"},"repairs":{"type":"array","items":{"type":"string"},"example":["stripped_markdown_fence","quoted_unquoted_keys","normalized_single_quotes","removed_trailing_commas","normalized_literals"]},"schema_valid":{"type":"boolean","nullable":true,"example":true},"schema_errors":{"type":"array","items":{"type":"string"},"example":[]}},"required":["valid","healed_json","repairs","schema_valid","schema_errors"]},"JsonHealRequest":{"type":"object","properties":{"raw":{"type":"string","minLength":1,"maxLength":262144,"example":"```json\n{ name: 'Tinplate', tags: ['api', 'edge',], active: True, }\n```","description":"Malformed JSON or LLM output string (max 256 KB)."},"schema":{"type":"object","additionalProperties":{"nullable":true},"example":{"type":"object","required":["name","active"],"properties":{"name":{"type":"string"},"active":{"type":"boolean"}}},"description":"Optional JSON Schema (draft subset) to validate the healed JSON against without eval."}},"required":["raw"]},"ResponseMeta":{"type":"object","required":["request_id"],"properties":{"request_id":{"type":"string","format":"uuid"},"ms":{"type":"integer","minimum":0},"version":{"type":"string","example":"1.0.0"}}},"ErrorEnvelope":{"type":"object","required":["ok","error","meta"],"properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"invalid_input"},"message":{"type":"string","example":"Request body failed validation"}}},"meta":{"$ref":"#/components/schemas/ResponseMeta"}}}},"parameters":{}},"paths":{"/v1/json-heal":{"post":{"tags":["10_JSON_HEAL"],"summary":"Heal broken JSON or LLM output","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonHealRequest"}}}},"responses":{"200":{"description":"Healing result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/JsonHealResponse"},"meta":{"$ref":"#/components/schemas/ResponseMeta"}},"required":["ok","data","meta"]}}}},"400":{"description":"Invalid input or malformed JSON request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid authentication credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Request payload exceeds subscribed plan byte cap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}}}