@kaito-http/core 4.0.0-beta.26 → 4.0.0-beta.28
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 +5 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1228,6 +1228,9 @@ var Router = class _Router {
|
|
|
1228
1228
|
const parsed = route.openapi.schema.serialize(result);
|
|
1229
1229
|
return head.toResponse(parsed);
|
|
1230
1230
|
}
|
|
1231
|
+
if (result === void 0) {
|
|
1232
|
+
return head.toResponse(null);
|
|
1233
|
+
}
|
|
1231
1234
|
return head.toResponse(result);
|
|
1232
1235
|
} catch (e) {
|
|
1233
1236
|
const error = WrappedError.maybe(e);
|
|
@@ -1308,11 +1311,12 @@ var Router = class _Router {
|
|
|
1308
1311
|
const addSchemaForRef = (ref) => {
|
|
1309
1312
|
const name = ref.name;
|
|
1310
1313
|
const properties = Object.fromEntries(Object.entries(ref.shape).map(([key, value]) => [key, value.toOpenAPI()]));
|
|
1314
|
+
const desc = ref.description();
|
|
1311
1315
|
const schemaObject = {
|
|
1312
1316
|
type: "object",
|
|
1313
1317
|
properties,
|
|
1314
1318
|
required: Object.keys(ref.shape),
|
|
1315
|
-
...
|
|
1319
|
+
...desc ? { description: desc } : {}
|
|
1316
1320
|
};
|
|
1317
1321
|
const existing = componentsSchemas[name];
|
|
1318
1322
|
if (existing) {
|
package/dist/index.js
CHANGED
|
@@ -256,6 +256,9 @@ var Router = class _Router {
|
|
|
256
256
|
const parsed = route.openapi.schema.serialize(result);
|
|
257
257
|
return head.toResponse(parsed);
|
|
258
258
|
}
|
|
259
|
+
if (result === void 0) {
|
|
260
|
+
return head.toResponse(null);
|
|
261
|
+
}
|
|
259
262
|
return head.toResponse(result);
|
|
260
263
|
} catch (e) {
|
|
261
264
|
const error = WrappedError.maybe(e);
|
|
@@ -336,11 +339,12 @@ var Router = class _Router {
|
|
|
336
339
|
const addSchemaForRef = (ref) => {
|
|
337
340
|
const name = ref.name;
|
|
338
341
|
const properties = Object.fromEntries(Object.entries(ref.shape).map(([key, value]) => [key, value.toOpenAPI()]));
|
|
342
|
+
const desc = ref.description();
|
|
339
343
|
const schemaObject = {
|
|
340
344
|
type: "object",
|
|
341
345
|
properties,
|
|
342
346
|
required: Object.keys(ref.shape),
|
|
343
|
-
...
|
|
347
|
+
...desc ? { description: desc } : {}
|
|
344
348
|
};
|
|
345
349
|
const existing = componentsSchemas[name];
|
|
346
350
|
if (existing) {
|