@omer-x/next-openapi-json-generator 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -429,7 +429,8 @@ async function generateOpenApiSpec(schemas, {
|
|
|
429
429
|
rootPath: additionalRootPath,
|
|
430
430
|
servers,
|
|
431
431
|
security,
|
|
432
|
-
securitySchemes
|
|
432
|
+
securitySchemes,
|
|
433
|
+
clearUnusedSchemas: clearUnusedSchemasOption = true
|
|
433
434
|
} = {}) {
|
|
434
435
|
const verifiedOptions = verifyOptions(includeOption, excludeOption);
|
|
435
436
|
const appFolderPath = await findAppFolderPath();
|
|
@@ -467,7 +468,7 @@ async function generateOpenApiSpec(schemas, {
|
|
|
467
468
|
version: metadata.version
|
|
468
469
|
},
|
|
469
470
|
servers,
|
|
470
|
-
...clearUnusedSchemas(pathsAndComponents),
|
|
471
|
+
...clearUnusedSchemasOption ? clearUnusedSchemas(pathsAndComponents) : pathsAndComponents,
|
|
471
472
|
security,
|
|
472
473
|
tags: []
|
|
473
474
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -11,7 +11,8 @@ type GeneratorOptions = {
|
|
|
11
11
|
servers?: ServerObject[];
|
|
12
12
|
security?: OpenApiDocument["security"];
|
|
13
13
|
securitySchemes?: ComponentsObject["securitySchemes"];
|
|
14
|
+
clearUnusedSchemas?: boolean;
|
|
14
15
|
};
|
|
15
|
-
declare function generateOpenApiSpec(schemas: Record<string, ZodType>, { include: includeOption, exclude: excludeOption, routeDefinerName, rootPath: additionalRootPath, servers, security, securitySchemes, }?: GeneratorOptions): Promise<Omit<OpenApiDocument, "components"> & Required<Pick<OpenApiDocument, "components">>>;
|
|
16
|
+
declare function generateOpenApiSpec(schemas: Record<string, ZodType>, { include: includeOption, exclude: excludeOption, routeDefinerName, rootPath: additionalRootPath, servers, security, securitySchemes, clearUnusedSchemas: clearUnusedSchemasOption, }?: GeneratorOptions): Promise<Omit<OpenApiDocument, "components"> & Required<Pick<OpenApiDocument, "components">>>;
|
|
16
17
|
|
|
17
18
|
export { generateOpenApiSpec as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,8 @@ type GeneratorOptions = {
|
|
|
11
11
|
servers?: ServerObject[];
|
|
12
12
|
security?: OpenApiDocument["security"];
|
|
13
13
|
securitySchemes?: ComponentsObject["securitySchemes"];
|
|
14
|
+
clearUnusedSchemas?: boolean;
|
|
14
15
|
};
|
|
15
|
-
declare function generateOpenApiSpec(schemas: Record<string, ZodType>, { include: includeOption, exclude: excludeOption, routeDefinerName, rootPath: additionalRootPath, servers, security, securitySchemes, }?: GeneratorOptions): Promise<Omit<OpenApiDocument, "components"> & Required<Pick<OpenApiDocument, "components">>>;
|
|
16
|
+
declare function generateOpenApiSpec(schemas: Record<string, ZodType>, { include: includeOption, exclude: excludeOption, routeDefinerName, rootPath: additionalRootPath, servers, security, securitySchemes, clearUnusedSchemas: clearUnusedSchemasOption, }?: GeneratorOptions): Promise<Omit<OpenApiDocument, "components"> & Required<Pick<OpenApiDocument, "components">>>;
|
|
16
17
|
|
|
17
18
|
export { generateOpenApiSpec as default };
|
package/dist/index.js
CHANGED
|
@@ -393,7 +393,8 @@ async function generateOpenApiSpec(schemas, {
|
|
|
393
393
|
rootPath: additionalRootPath,
|
|
394
394
|
servers,
|
|
395
395
|
security,
|
|
396
|
-
securitySchemes
|
|
396
|
+
securitySchemes,
|
|
397
|
+
clearUnusedSchemas: clearUnusedSchemasOption = true
|
|
397
398
|
} = {}) {
|
|
398
399
|
const verifiedOptions = verifyOptions(includeOption, excludeOption);
|
|
399
400
|
const appFolderPath = await findAppFolderPath();
|
|
@@ -431,7 +432,7 @@ async function generateOpenApiSpec(schemas, {
|
|
|
431
432
|
version: metadata.version
|
|
432
433
|
},
|
|
433
434
|
servers,
|
|
434
|
-
...clearUnusedSchemas(pathsAndComponents),
|
|
435
|
+
...clearUnusedSchemasOption ? clearUnusedSchemas(pathsAndComponents) : pathsAndComponents,
|
|
435
436
|
security,
|
|
436
437
|
tags: []
|
|
437
438
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omer-x/next-openapi-json-generator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "a Next.js plugin to generate OpenAPI documentation from route handlers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"next.js",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"build": "tsup"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@omer-x/package-metadata": "^1.0.
|
|
48
|
+
"@omer-x/package-metadata": "^1.0.2",
|
|
49
49
|
"minimatch": "^10.0.1",
|
|
50
50
|
"typescript": "^5.6.3",
|
|
51
51
|
"zod-to-json-schema": "^3.23.5"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@omer-x/eslint-config": "^2.0.2",
|
|
55
|
-
"@types/node": "^22.
|
|
56
|
-
"eslint": "^9.
|
|
55
|
+
"@types/node": "^22.9.0",
|
|
56
|
+
"eslint": "^9.14.0",
|
|
57
57
|
"semantic-release": "^24.2.0",
|
|
58
58
|
"ts-jest": "^29.2.5",
|
|
59
59
|
"ts-node": "^10.9.2",
|