UNPKG

@samchon/openapi

Version:

Universal OpenAPI to LLM function calling schemas. Transform any Swagger/OpenAPI document into type-safe schemas for OpenAI, Claude, Qwen, and more.

11 lines (9 loc) 336 B
import { OpenApi } from "../../OpenApi"; import { IOpenApiValidatorContext } from "./IOpenApiValidatorContext"; export namespace OpenApiBooleanValidator { export const validate = ( ctx: IOpenApiValidatorContext<OpenApi.IJsonSchema.IBoolean>, ): boolean => { return typeof ctx.value === "boolean" || ctx.report(ctx); }; }