@kizunajs/openapi 2.0.0-beta.12 → 2.0.0-beta.13
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 +8 -4
- package/dist/index.mjs +8 -4
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -91,10 +91,10 @@ const JSON_ENCODING = {
|
|
|
91
91
|
bigint: { type: "string" }
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
|
-
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message
|
|
95
|
-
* `example` holds one value or several
|
|
96
|
-
* `examples` array
|
|
97
|
-
* Swift's `@available`.
|
|
94
|
+
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message,
|
|
95
|
+
* `example` holds one value or several, and `brand` has no keyword. Emit
|
|
96
|
+
* `deprecated: true`, an `examples` array and `x-kizuna-brand`; the message
|
|
97
|
+
* stays in outputs with a place for it, like Swift's `@available`.
|
|
98
98
|
*/
|
|
99
99
|
const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
100
100
|
const encoding = JSON_ENCODING[(0, kizunajs_generator.readDef)(zodSchema).type ?? ""];
|
|
@@ -106,6 +106,10 @@ const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
|
106
106
|
jsonSchema.examples = [...given, ...declared];
|
|
107
107
|
delete jsonSchema.example;
|
|
108
108
|
}
|
|
109
|
+
if ("brand" in jsonSchema) {
|
|
110
|
+
jsonSchema["x-kizuna-brand"] = jsonSchema.brand;
|
|
111
|
+
delete jsonSchema.brand;
|
|
112
|
+
}
|
|
109
113
|
};
|
|
110
114
|
const toJsonSchema = (schema, io = "output") => {
|
|
111
115
|
const id = (0, kizunajs_generator.readMetaId)(schema);
|
package/dist/index.mjs
CHANGED
|
@@ -90,10 +90,10 @@ const JSON_ENCODING = {
|
|
|
90
90
|
bigint: { type: "string" }
|
|
91
91
|
};
|
|
92
92
|
/**
|
|
93
|
-
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message
|
|
94
|
-
* `example` holds one value or several
|
|
95
|
-
* `examples` array
|
|
96
|
-
* Swift's `@available`.
|
|
93
|
+
* kizuna's metadata widens JSON Schema: `deprecated` may carry a message,
|
|
94
|
+
* `example` holds one value or several, and `brand` has no keyword. Emit
|
|
95
|
+
* `deprecated: true`, an `examples` array and `x-kizuna-brand`; the message
|
|
96
|
+
* stays in outputs with a place for it, like Swift's `@available`.
|
|
97
97
|
*/
|
|
98
98
|
const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
99
99
|
const encoding = JSON_ENCODING[readDef(zodSchema).type ?? ""];
|
|
@@ -105,6 +105,10 @@ const normalizeMeta = ({ zodSchema, jsonSchema }) => {
|
|
|
105
105
|
jsonSchema.examples = [...given, ...declared];
|
|
106
106
|
delete jsonSchema.example;
|
|
107
107
|
}
|
|
108
|
+
if ("brand" in jsonSchema) {
|
|
109
|
+
jsonSchema["x-kizuna-brand"] = jsonSchema.brand;
|
|
110
|
+
delete jsonSchema.brand;
|
|
111
|
+
}
|
|
108
112
|
};
|
|
109
113
|
const toJsonSchema = (schema, io = "output") => {
|
|
110
114
|
const id = readMetaId(schema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kizunajs/openapi",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.13",
|
|
4
4
|
"description": "OpenAPI 3.1 generation for Kizuna.js APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kizunajs",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"zod": "^4.0.0",
|
|
63
|
-
"kizunajs": "2.0.0-beta.
|
|
63
|
+
"kizunajs": "2.0.0-beta.13"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/express": "^5.0.0",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"tsdown": "^0.21.0",
|
|
69
69
|
"typescript": "^6.0.3",
|
|
70
70
|
"zod": "^4.0.0",
|
|
71
|
-
"kizunajs": "2.0.0-beta.
|
|
72
|
-
"@kizunajs/express": "2.0.0-beta.
|
|
71
|
+
"kizunajs": "2.0.0-beta.13",
|
|
72
|
+
"@kizunajs/express": "2.0.0-beta.13"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "tsdown src/index.ts --format esm,cjs --dts --clean --external kizunajs --external zod",
|