@1szx1/vite-plugin-swagger2ts 1.3.20 → 1.3.21
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 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -190,9 +190,11 @@ function generatorParameterType(schemas, docsName) {
|
|
|
190
190
|
}
|
|
191
191
|
function generatorRequestBodyType(schemas, docsName) {
|
|
192
192
|
const { description, content, required } = schemas;
|
|
193
|
-
|
|
193
|
+
let schema = content && Object.values(content)[0]?.["schema"];
|
|
194
194
|
if (!schema)
|
|
195
195
|
return "";
|
|
196
|
+
if ("properties" in schema)
|
|
197
|
+
schema = { ...schema, required: schema.required || [] };
|
|
196
198
|
const result = generatorSchemaType("", schema, { docsName });
|
|
197
199
|
return jsDoc({ description }, { key: "body", result, isRequired: required });
|
|
198
200
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -181,9 +181,11 @@ function generatorParameterType(schemas, docsName) {
|
|
|
181
181
|
}
|
|
182
182
|
function generatorRequestBodyType(schemas, docsName) {
|
|
183
183
|
const { description, content, required } = schemas;
|
|
184
|
-
|
|
184
|
+
let schema = content && Object.values(content)[0]?.["schema"];
|
|
185
185
|
if (!schema)
|
|
186
186
|
return "";
|
|
187
|
+
if ("properties" in schema)
|
|
188
|
+
schema = { ...schema, required: schema.required || [] };
|
|
187
189
|
const result = generatorSchemaType("", schema, { docsName });
|
|
188
190
|
return jsDoc({ description }, { key: "body", result, isRequired: required });
|
|
189
191
|
}
|
package/package.json
CHANGED