/* * 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 { ErrorLocation, ErrorLocation$inboundSchema } from "./errorlocation.js"; export type ErrorDetail = { location: ErrorLocation; /** * A JSON pointer for the particular property that caused the error. */ pointer: string; /** * A human-readdable explanation of the error. */ message: string; /** * The type of error that was raised for this property. */ type: string; }; /** @internal */ export const ErrorDetail$inboundSchema: z.ZodType< ErrorDetail, z.ZodTypeDef, unknown > = z.object({ location: ErrorLocation$inboundSchema, pointer: z.string(), message: z.string(), type: z.string(), }); export function errorDetailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ErrorDetail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ErrorDetail' from JSON`, ); }