{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ophis-fi/json-schema/ophis-fi-intent-success-schema.json",
  "title": "IntentSuccess",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ophis-fi-openapi.json#/components/schemas/IntentSuccess",
  "type": "object",
  "required": [
    "ok",
    "data"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "data": {
      "$ref": "#/$defs/ParsedIntent"
    }
  },
  "$defs": {
    "Entity": {
      "type": "object",
      "required": [
        "type",
        "value",
        "raw",
        "start",
        "end"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "sellToken",
            "buyToken",
            "amount",
            "chain"
          ]
        },
        "value": {
          "type": "string",
          "description": "Normalized value (e.g. \"optimism\", \"USDC\", \"100\")."
        },
        "raw": {
          "type": "string",
          "description": "A case-insensitive match somewhere in the input; offsets may be inaccurate."
        },
        "start": {
          "type": "integer",
          "description": "Model-proposed in-bounds start offset; re-anchor raw before highlighting."
        },
        "end": {
          "type": "integer",
          "description": "Model-proposed in-bounds end offset (exclusive); not an exact-span guarantee."
        }
      }
    },
    "ParsedIntent": {
      "type": "object",
      "required": [
        "intent",
        "entities"
      ],
      "properties": {
        "intent": {
          "type": "string",
          "enum": [
            "swap",
            "unknown"
          ]
        },
        "entities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Entity"
          }
        }
      }
    }
  }
}