본문으로 건너뛰기

타입 별칭: SchemaInput

type SchemaInput = 
| StandardJSONSchemaV1<any, any>
| StandardSchemaV1<any, any>
| JSONSchema;

정의 위치: packages/ai/src/types.ts:146

스키마 입력을 위한 유니언 타입입니다. Standard Schema 호환 검증기, Standard JSON Schema 호환 스키마 또는 일반 JSONSchema 객체일 수 있습니다.

표준 JSON 스키마 준수 라이브러리 (JSON-schema 컨버터를 포함):

  • Zod v4.2+ (표준 JSON 스키마 V1 를 기본적으로 지원)
  • ArkType v2.1.28+ (표준 JSON 스키마 V1 를 기본적으로 지원)
  • Valibot v1.2+ (toStandardJsonSchema() 에서 @valibot/to-json-schema 를 통해)

StandardSchemaV1은 공개된 타입이 검증기 인터페이스만 노출하는 라이브러리를 포함합니다. Zod의 핵심 $ZodType['~standard']는 현재 StandardSchemaV1.Props로 타입이 지정되지만 런타임에서는 jsonSchema 변환기가 연결됩니다. 따라서 이 분기는 InferSchemaTypez.ZodType<T>를 사용하는 호출자의 추론된 타입을 복원하도록 합니다.

참조

https://standardschema.dev/json-schema