Skip to content

Commit

Permalink
feat: upgrade upstream to v7
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vacas5 committed Dec 4, 2024
1 parent e6b4173 commit 94fd8c6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 38 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test": "NODE_ENV=test mocha --exit"
},
"dependencies": {
"@asteasolutions/zod-to-openapi": "^6.4.0"
"@asteasolutions/zod-to-openapi": "^7.2.0"
},
"peerDependencies": {
"express": "^5.0.0-beta.1",
Expand Down
58 changes: 25 additions & 33 deletions src/openAPI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,18 @@ describe("buildOpenAPIDocument", () => {
type: "object",
properties: {
address: {
items: {
anyOf: [
{
type: "integer",
},
{
type: "string",
},
{
enum: ["street", "avenue", "boulevard"],
type: "string",
},
],
},
maxItems: 3,
minItems: 3,
prefixItems: [
{
type: "integer",
},
{
type: "string",
},
{
enum: ["street", "avenue", "boulevard"],
type: "string",
},
],
type: "array",
},
name: { type: "string" },
Expand All @@ -95,22 +91,18 @@ describe("buildOpenAPIDocument", () => {
type: "object",
properties: {
address: {
items: {
anyOf: [
{
type: "integer",
},
{
type: "string",
},
{
enum: ["street", "avenue", "boulevard"],
type: "string",
},
],
},
maxItems: 3,
minItems: 3,
prefixItems: [
{
type: "integer",
},
{
type: "string",
},
{
enum: ["street", "avenue", "boulevard"],
type: "string",
},
],
type: "array",
},
name: { type: "string" },
Expand Down Expand Up @@ -268,6 +260,6 @@ describe("buildOpenAPIDocument", () => {
const responseSchema = document.components!.schemas!.ResponseSchema as SchemaObject;
const value = responseSchema.properties!.value as SchemaObject;

expect(value.type).to.equal("integer");
expect(value.type).to.equal("string");
});
});
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


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

Expand Down

0 comments on commit 94fd8c6

Please sign in to comment.