Skip to content

Commit 534d552

Browse files
committed
refactor: schema object imports
1 parent 0671f73 commit 534d552

6 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/core/createMediaType.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "vitest";
22
import createMediaType from "./createMediaType";
3-
import type { SchemaObject } from "@omer-x/openapi-types/schema";
3+
import type { SchemaObject } from "@omer-x/json-schema-types";
44

55
describe("createMediaType", () => {
66
const mockSchema: SchemaObject = { type: "string" };

src/core/createMediaType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Entry } from "~/types/entry";
22
import type { MediaTypeObject } from "@omer-x/openapi-types/media-type";
3-
import type { SchemaObject } from "@omer-x/openapi-types/schema";
3+
import type { SchemaObject } from "@omer-x/json-schema-types";
44

55
export default function createMediaType(
66
schema: SchemaObject,

src/core/zod-to-openapi.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, it } from "vitest";
22
import z from "zod";
33
import convertToOpenAPI from "./zod-to-openapi";
4-
import type { SchemaObject } from "@omer-x/openapi-types/schema";
4+
import type { SchemaObject } from "@omer-x/json-schema-types";
55

66
describe("convertToOpenAPI", () => {
77
it("should convert a simple Zod schema to OpenAPI schema", () => {
@@ -20,7 +20,6 @@ describe("convertToOpenAPI", () => {
2020
},
2121
required: ["name", "age"],
2222
additionalProperties: false,
23-
// @ts-expect-error: @omer-x/openapi-types doesn't have this
2423
$schema: "https://json-schema.org/draft/2020-12/schema",
2524
};
2625

@@ -35,7 +34,6 @@ describe("convertToOpenAPI", () => {
3534
const expectedSchema: SchemaObject = {
3635
type: "array",
3736
items: { type: "string" },
38-
// @ts-expect-error: @omer-x/openapi-types doesn't have this
3937
$schema: "https://json-schema.org/draft/2020-12/schema",
4038
};
4139

@@ -67,7 +65,6 @@ describe("convertToOpenAPI", () => {
6765
},
6866
required: ["user"],
6967
additionalProperties: false,
70-
// @ts-expect-error: @omer-x/openapi-types doesn't have this
7168
$schema: "https://json-schema.org/draft/2020-12/schema",
7269
};
7370

@@ -92,7 +89,6 @@ describe("convertToOpenAPI", () => {
9289
},
9390
required: ["file"],
9491
additionalProperties: false,
95-
// @ts-expect-error: @omer-x/openapi-types doesn't have this
9692
$schema: "https://json-schema.org/draft/2020-12/schema",
9793
};
9894

src/core/zod-to-openapi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ZodType, z } from "zod";
2-
import type { SchemaObject } from "@omer-x/openapi-types/schema";
2+
import type { SchemaObject } from "@omer-x/json-schema-types";
33

44
export default function convertToOpenAPI(schema: ZodType<unknown>, isArray: boolean) {
55
return z.toJSONSchema(isArray ? schema.array() : schema) as SchemaObject;

src/utils/openapi-components.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from "vitest";
22
import { createSchemaRef } from "./openapi-components";
3-
import type { SchemaObject } from "@omer-x/openapi-types/schema";
3+
import type { SchemaObject } from "@omer-x/json-schema-types";
44

55
describe("createSchemaRef", () => {
66
it("should create a schema reference for a single schema", () => {

src/utils/openapi-components.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { SchemaObject } from "@omer-x/openapi-types/schema";
1+
import type { SchemaObject } from "@omer-x/json-schema-types";
22

33
export function createSchemaRef(schemaName: string, isArray: boolean) {
44
const refObject = { $ref: `#/components/schemas/${schemaName}` } as SchemaObject;

0 commit comments

Comments
 (0)