fix(schema): restore z.toJSONSchema native v4 API

This commit is contained in:
YeonGyu-Kim
2026-04-08 12:59:54 +09:00
parent f4eabf9f0e
commit 18771c8d6d
2 changed files with 6076 additions and 4 deletions
File diff suppressed because it is too large Load Diff
+6 -3
View File
@@ -1,14 +1,17 @@
import { zodToJsonSchema } from "zod-to-json-schema"
import { z } from "zod"
import { OhMyOpenCodeConfigSchema } from "../src/config/schema"
export function createOhMyOpenCodeJsonSchema(): Record<string, unknown> {
const jsonSchema = zodToJsonSchema(OhMyOpenCodeConfigSchema) as Record<string, unknown>
const jsonSchema = z.toJSONSchema(OhMyOpenCodeConfigSchema, {
target: "draft-7",
unrepresentable: "any",
}) as Record<string, unknown>
return {
...jsonSchema,
$schema: "http://json-schema.org/draft-07/schema#",
$id: "https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/oh-my-opencode.schema.json",
title: "Oh My OpenCode Configuration",
description: "Configuration schema for oh-my-opencode plugin",
...jsonSchema,
}
}