{
  "x402Version": 2,
  "id": 2980,
  "slug": "2980",
  "resource": "https://x402.fenixfoundry.com/repair-json",
  "description": "Repair malformed JSON (trailing commas, single quotes, unquoted keys, code fences, truncated output) and optionally validate the result against a supplied JSON Schema. Returns the parsed value, the canonical text, a change log and validation errors.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x737426d3eD53930B889b3f61774669a0FDf3BE54",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "3000",
      "maxTimeoutSeconds": 60
    }
  ],
  "outputSchema": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "input": "```json\n{name: \"ada\", tags: [\"math\", \"code\",]}\n```",
            "schema": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "tags": {
                  "type": "array"
                }
              },
              "required": [
                "name"
              ],
              "type": "object"
            }
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "changed": true,
            "changes": [
              "stripped markdown code fence",
              "repaired JSON syntax"
            ],
            "errors": [],
            "repaired": {
              "name": "ada",
              "tags": [
                "math",
                "code"
              ]
            },
            "repairedText": "{\"name\":\"ada\",\"tags\":[\"math\",\"code\"]}",
            "valid": true
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "input": {
                    "description": "Malformed JSON text — trailing commas, single quotes, unquoted keys, markdown code fences, truncated output, etc.",
                    "type": "string"
                  },
                  "schema": {
                    "description": "Optional JSON Schema (draft 2020-12) to validate the repaired value against.",
                    "type": "object"
                  }
                },
                "required": [
                  "input"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "properties": {
                  "changed": {
                    "type": "boolean"
                  },
                  "changes": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "errors": {
                    "items": {
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "repaired": {},
                  "repairedText": {
                    "type": "string"
                  },
                  "valid": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "repaired",
                  "repairedText",
                  "changes"
                ],
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "bazaar"
  ],
  "sourceHost": "x402.fenixfoundry.com",
  "lastUpdated": "2026-09-11T03:37:59.848Z",
  "quality": {
    "calls30d": 5,
    "uniquePayers30d": 3,
    "lastCalledAt": "2026-09-11T03:37:59.462Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "x402.fenixfoundry.com",
    "manifest_name": "x402.fenixfoundry.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}