vls-openapi-generator 1.2.0 → 1.2.2
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/generate-openapi.js +5 -1
- package/dist/openapi-type.d.ts +7 -15
- package/package.json +1 -2
- package/src/generate-openapi.ts +6 -2
- package/src/openapi-type.ts +1 -14
package/dist/generate-openapi.js
CHANGED
|
@@ -62,7 +62,11 @@ const generateTemplate = async () => {
|
|
|
62
62
|
: { params: zod_1.z.object({}) }),
|
|
63
63
|
...(eventResponseModulesSchema
|
|
64
64
|
? { modules: eventResponseModulesSchema }
|
|
65
|
-
: {
|
|
65
|
+
: {
|
|
66
|
+
modules: (0, zod_openapi_1.extendApi)(zod_1.z.array(zod_1.z.unknown()), {
|
|
67
|
+
example: []
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
66
70
|
fallback: zod_1.z.boolean().default(false)
|
|
67
71
|
}), undefined, '3.0');
|
|
68
72
|
const queryParameters = [];
|
package/dist/openapi-type.d.ts
CHANGED
|
@@ -5,17 +5,13 @@ export type OpenAPI = {
|
|
|
5
5
|
title: string;
|
|
6
6
|
version: string;
|
|
7
7
|
};
|
|
8
|
-
servers: [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
url: string;
|
|
17
|
-
}
|
|
18
|
-
];
|
|
8
|
+
servers: [{
|
|
9
|
+
url: string;
|
|
10
|
+
}, {
|
|
11
|
+
url: string;
|
|
12
|
+
}, {
|
|
13
|
+
url: string;
|
|
14
|
+
}];
|
|
19
15
|
paths: Record<string, {
|
|
20
16
|
post: {
|
|
21
17
|
parameters: {
|
|
@@ -44,8 +40,4 @@ export type OpenAPI = {
|
|
|
44
40
|
tags: string[];
|
|
45
41
|
};
|
|
46
42
|
}>;
|
|
47
|
-
components: {
|
|
48
|
-
parameters: Record<string, object>;
|
|
49
|
-
schemas: Record<string, object>;
|
|
50
|
-
};
|
|
51
43
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vls-openapi-generator",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"main": "dist/generate-template.js",
|
|
5
5
|
"types": "dist/lambda-type.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"@types/node": "^20.14.8",
|
|
27
27
|
"commitlint": "^19.5.0",
|
|
28
28
|
"eslint": "^9.12.0",
|
|
29
|
-
"globals": "^15.11.0",
|
|
30
29
|
"husky": "^9.1.6",
|
|
31
30
|
"prettier": "^2.7.1",
|
|
32
31
|
"semantic-release": "^24.1.2",
|
package/src/generate-openapi.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { generateSchema, OpenApiZodAny } from '@anatine/zod-openapi';
|
|
3
|
+
import { extendApi, generateSchema, OpenApiZodAny } from '@anatine/zod-openapi';
|
|
4
4
|
import { exec } from 'child_process';
|
|
5
5
|
import { promises as fs } from 'fs';
|
|
6
6
|
import 'module-alias/register.js';
|
|
@@ -50,7 +50,11 @@ const generateTemplate = async (): Promise<void> => {
|
|
|
50
50
|
: { params: z.object({}) }),
|
|
51
51
|
...(eventResponseModulesSchema
|
|
52
52
|
? { modules: eventResponseModulesSchema }
|
|
53
|
-
: {
|
|
53
|
+
: {
|
|
54
|
+
modules: extendApi(z.array(z.unknown()), {
|
|
55
|
+
example: []
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
54
58
|
fallback: z.boolean().default(false)
|
|
55
59
|
}),
|
|
56
60
|
undefined,
|
package/src/openapi-type.ts
CHANGED
|
@@ -3,16 +3,7 @@ import { generateSchema } from '@anatine/zod-openapi';
|
|
|
3
3
|
export type OpenAPI = {
|
|
4
4
|
openapi: '3.0.0';
|
|
5
5
|
info: { title: string; version: string };
|
|
6
|
-
servers: [
|
|
7
|
-
{ url: string },
|
|
8
|
-
{
|
|
9
|
-
url: string;
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
url: string;
|
|
14
|
-
}
|
|
15
|
-
];
|
|
6
|
+
servers: [{ url: string }, { url: string }, { url: string }];
|
|
16
7
|
paths: Record<
|
|
17
8
|
string,
|
|
18
9
|
{
|
|
@@ -50,8 +41,4 @@ export type OpenAPI = {
|
|
|
50
41
|
};
|
|
51
42
|
}
|
|
52
43
|
>;
|
|
53
|
-
components: {
|
|
54
|
-
parameters: Record<string, object>;
|
|
55
|
-
schemas: Record<string, object>;
|
|
56
|
-
};
|
|
57
44
|
};
|