Skip to content

Commit

Permalink
Merge branch 'master' into drop-peer-alt-error-variation
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail committed Sep 1, 2024
2 parents 46d2250 + f950252 commit 3d8ab98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ZodError } from "zod";
import { z } from "zod";
import { getMessageFromError } from "./common-helpers";
import { OpenAPIContext } from "./documentation-helpers";

Expand Down Expand Up @@ -38,7 +38,7 @@ export class IOSchemaError extends Error {
export class OutputValidationError extends IOSchemaError {
public override name = "OutputValidationError";

constructor(public readonly originalError: ZodError) {
constructor(public readonly originalError: z.ZodError) {
super(getMessageFromError(originalError));
}
}
Expand All @@ -47,7 +47,7 @@ export class OutputValidationError extends IOSchemaError {
export class InputValidationError extends IOSchemaError {
public override name = "InputValidationError";

constructor(public readonly originalError: ZodError) {
constructor(public readonly originalError: z.ZodError) {
super(getMessageFromError(originalError));
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/errors.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ZodError } from "zod";
import { z } from "zod";
import { DocumentationError, RoutingError } from "../../src";
import {
IOSchemaError,
Expand Down Expand Up @@ -56,7 +56,7 @@ describe("Errors", () => {
});

describe("OutputValidationError", () => {
const zodError = new ZodError([]);
const zodError = new z.ZodError([]);
const error = new OutputValidationError(zodError);

test("should be an instance of IOSchemaError and Error", () => {
Expand All @@ -74,7 +74,7 @@ describe("Errors", () => {
});

describe("InputValidationError", () => {
const zodError = new ZodError([]);
const zodError = new z.ZodError([]);
const error = new InputValidationError(zodError);

test("should be an instance of IOSchemaError and Error", () => {
Expand Down

0 comments on commit 3d8ab98

Please sign in to comment.