{
  "$schema": "https://hyperjs.ai/schema/registry-item.json",
  "name": "openapi-arktype",
  "version": "0.1.0",
  "description": "SchemaConverter for ArkType to @hyper/openapi.",
  "readme": "# @hyper/openapi-arktype\n\nArkType `SchemaConverter` for `@hyper/openapi`.\n\n## Install\n\nComponents are installed as source into your repo, not pulled from npm. `arktype` is added to your `package.json` automatically as a peer dependency.\n\n```bash\nbunx hyper add openapi openapi-arktype\n```\n\n## Usage\n\n```ts\nimport { Hyper } from \"@hyper/core\"\nimport { openapiPlugin } from \"@hyper/openapi\"\nimport { arktypeConverter } from \"@hyper/openapi-arktype\"\n\nexport default new Hyper()\n  .use(openapiPlugin({ converter: arktypeConverter }))\n  .listen(3000)\n```\n\n## Docs\n\nSee the [main README](../../README.md) and [docs/](../../docs) for guides and integration recipes.\n\n## License\n\nMIT\n",
  "registryDeps": [
    "openapi"
  ],
  "peerDeps": {},
  "optionalPeerDeps": {},
  "files": [
    {
      "path": "openapi-arktype/index.ts",
      "contents": "/**\n * @hyper/openapi-arktype — SchemaConverter for ArkType.\n *\n * ArkType types expose a `toJsonSchema()` method (v2+). We thin-wrap that\n * so users get proper JSON Schema without pulling ArkType at runtime.\n */\n\nimport type { JsonSchema, SchemaConverter } from \"@hyper/openapi\"\n\ninterface ArkType {\n  readonly toJsonSchema?: () => JsonSchema\n  readonly infer?: unknown\n  readonly definition?: unknown\n}\n\nfunction isArkType(s: unknown): s is ArkType {\n  if (!s || typeof s !== \"object\") return false\n  const x = s as Record<string, unknown>\n  return typeof x.toJsonSchema === \"function\" && (\"infer\" in x || \"definition\" in x)\n}\n\nexport const arktypeConverter: SchemaConverter = {\n  name: \"arktype\",\n  canHandle: isArkType,\n  toJsonSchema: (s) => {\n    const t = s as ArkType\n    try {\n      return t.toJsonSchema?.() ?? { type: \"object\" }\n    } catch {\n      return { type: \"object\" }\n    }\n  },\n}\n",
      "sha256": "0204827d71f8ee4830290effe4e980c717bff83544cea4bfb50b255855e7cfeb"
    }
  ],
  "subpaths": {}
}