/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { UiSchemaGroupEnum, UiSchemaGroupEnum$inboundSchema, } from "./uischemagroupenum.js"; import { UiSchemaProperty, UiSchemaProperty$inboundSchema, } from "./uischemaproperty.js"; export type UiSchema = { /** * Group of the UI Schema */ group?: UiSchemaGroupEnum | undefined; /** * Properties of the UI Schema */ properties?: { [k: string]: UiSchemaProperty } | undefined; }; /** @internal */ export const UiSchema$inboundSchema: z.ZodType< UiSchema, z.ZodTypeDef, unknown > = z.object({ group: UiSchemaGroupEnum$inboundSchema.optional(), properties: z.record(UiSchemaProperty$inboundSchema).optional(), }); export function uiSchemaFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UiSchema$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UiSchema' from JSON`, ); }