Skip to content

Commit 9c10e1f

Browse files
authored
feat: upgrade upstream to v7 (#16)
Update zod-to-openapi dependency to their version 7. Update tests to reflect the breaking changes upstream. BREAKING CHANGE: document now treats bigint differently in all openapi versions and tuples differently in 3.1.0 More details here https://github.com/asteasolutions/zod-to-openapi/releases/tag/v7.0.0
1 parent e6b4173 commit 9c10e1f

File tree

3 files changed

+30
-38
lines changed

3 files changed

+30
-38
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test": "NODE_ENV=test mocha --exit"
1717
},
1818
"dependencies": {
19-
"@asteasolutions/zod-to-openapi": "^6.4.0"
19+
"@asteasolutions/zod-to-openapi": "^7.2.0"
2020
},
2121
"peerDependencies": {
2222
"express": "^5.0.0-beta.1",

Diff for: src/openAPI.test.ts

+25-33
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,18 @@ describe("buildOpenAPIDocument", () => {
6767
type: "object",
6868
properties: {
6969
address: {
70-
items: {
71-
anyOf: [
72-
{
73-
type: "integer",
74-
},
75-
{
76-
type: "string",
77-
},
78-
{
79-
enum: ["street", "avenue", "boulevard"],
80-
type: "string",
81-
},
82-
],
83-
},
84-
maxItems: 3,
85-
minItems: 3,
70+
prefixItems: [
71+
{
72+
type: "integer",
73+
},
74+
{
75+
type: "string",
76+
},
77+
{
78+
enum: ["street", "avenue", "boulevard"],
79+
type: "string",
80+
},
81+
],
8682
type: "array",
8783
},
8884
name: { type: "string" },
@@ -95,22 +91,18 @@ describe("buildOpenAPIDocument", () => {
9591
type: "object",
9692
properties: {
9793
address: {
98-
items: {
99-
anyOf: [
100-
{
101-
type: "integer",
102-
},
103-
{
104-
type: "string",
105-
},
106-
{
107-
enum: ["street", "avenue", "boulevard"],
108-
type: "string",
109-
},
110-
],
111-
},
112-
maxItems: 3,
113-
minItems: 3,
94+
prefixItems: [
95+
{
96+
type: "integer",
97+
},
98+
{
99+
type: "string",
100+
},
101+
{
102+
enum: ["street", "avenue", "boulevard"],
103+
type: "string",
104+
},
105+
],
114106
type: "array",
115107
},
116108
name: { type: "string" },
@@ -268,6 +260,6 @@ describe("buildOpenAPIDocument", () => {
268260
const responseSchema = document.components!.schemas!.ResponseSchema as SchemaObject;
269261
const value = responseSchema.properties!.value as SchemaObject;
270262

271-
expect(value.type).to.equal("integer");
263+
expect(value.type).to.equal("string");
272264
});
273265
});

Diff for: yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# yarn lockfile v1
33

44

5-
"@asteasolutions/zod-to-openapi@^6.4.0":
6-
version "6.4.0"
7-
resolved "https://registry.yarnpkg.com/@asteasolutions/zod-to-openapi/-/zod-to-openapi-6.4.0.tgz#3081e7f56febdb7c58fcee4dd5cfb3cbcb01742c"
8-
integrity sha512-8cxfF7AHHx2PqnN4Cd8/O8CBu/nVYJP9DpnfVLW3BFb66VJDnqI/CczZnkqMc3SNh6J9GiX7JbJ5T4BSP4HZ2Q==
5+
"@asteasolutions/zod-to-openapi@^7.2.0":
6+
version "7.2.0"
7+
resolved "https://registry.yarnpkg.com/@asteasolutions/zod-to-openapi/-/zod-to-openapi-7.2.0.tgz#19bf1f8bbd380a2ca95d6b1818f7437703da69b1"
8+
integrity sha512-Va+Fq1QzKkSgmiYINSp3cASFhMsbdRH/kmCk2feijhC+yNjGoC056CRqihrVFhR8MY8HOZHdlYm2Ns2lmszCiw==
99
dependencies:
1010
openapi3-ts "^4.1.2"
1111

0 commit comments

Comments
 (0)