/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { smartUnion } from "../types/smart-union.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type Path = string | number; export type ErrorIssue = { /** * What is wrong. */ message: string; /** * Location of the invalid field in the request body. */ path?: Array | undefined; /** * Validation rule that failed. */ code?: string | undefined; }; /** @internal */ export const Path$inboundSchema: z.ZodMiniType = smartUnion([ types.string(), types.number(), ]); export function pathFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Path$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Path' from JSON`, ); } /** @internal */ export const ErrorIssue$inboundSchema: z.ZodMiniType = z .object({ message: types.string(), path: types.optional(z.array(smartUnion([types.string(), types.number()]))), code: types.optional(types.string()), }); export function errorIssueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ErrorIssue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorIssue' from JSON`, ); }