@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
35 lines • 1.39 kB
JavaScript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
/** @internal */
export const ValidationError$inboundSchema = z.object({
location: z.string(),
message: z.string(),
fix: z.string().optional(),
});
/** @internal */
export const ValidationError$outboundSchema = z.object({
location: z.string(),
message: z.string(),
fix: z.string().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export var ValidationError$;
(function (ValidationError$) {
/** @deprecated use `ValidationError$inboundSchema` instead. */
ValidationError$.inboundSchema = ValidationError$inboundSchema;
/** @deprecated use `ValidationError$outboundSchema` instead. */
ValidationError$.outboundSchema = ValidationError$outboundSchema;
})(ValidationError$ || (ValidationError$ = {}));
export function validationErrorToJSON(validationError) {
return JSON.stringify(ValidationError$outboundSchema.parse(validationError));
}
export function validationErrorFromJSON(jsonString) {
return safeParse(jsonString, (x) => ValidationError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ValidationError' from JSON`);
}
//# sourceMappingURL=validationerror.js.map