@elysiajs/openapi 1.4.8-beta.0 → 1.4.9
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/bunfig.toml +2 -0
- package/dist/cjs/gen/index.js +6 -6
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/openapi.js +2 -2
- package/dist/gen/index.mjs +6 -6
- package/dist/index.mjs +2 -2
- package/dist/openapi.mjs +2 -2
- package/package.json +1 -1
package/bunfig.toml
ADDED
package/dist/cjs/gen/index.js
CHANGED
|
@@ -8323,7 +8323,9 @@ function extractRootObjects(code) {
|
|
|
8323
8323
|
let keyEnd = colonIdx - 1;
|
|
8324
8324
|
while (keyEnd >= 0 && /\s/.test(code[keyEnd])) keyEnd--;
|
|
8325
8325
|
let keyStart = keyEnd;
|
|
8326
|
-
while (keyStart >= 0 &&
|
|
8326
|
+
while (keyStart >= 0 && !/[\s{};,\n]/.test(code[keyStart])) {
|
|
8327
|
+
keyStart--;
|
|
8328
|
+
}
|
|
8327
8329
|
const braceIdx = code.indexOf("{", colonIdx);
|
|
8328
8330
|
if (braceIdx === -1) break;
|
|
8329
8331
|
let depth = 0;
|
|
@@ -8457,12 +8459,10 @@ var fromTypes = (targetFilePath, {
|
|
|
8457
8459
|
3
|
|
8458
8460
|
)
|
|
8459
8461
|
);
|
|
8460
|
-
const routesString = extractRootObjects(instance)[0].replace(
|
|
8461
|
-
matchStatus,
|
|
8462
|
-
'"$1":'
|
|
8463
|
-
);
|
|
8464
8462
|
const routes = {};
|
|
8465
|
-
for (const route of extractRootObjects(
|
|
8463
|
+
for (const route of extractRootObjects(
|
|
8464
|
+
instance.slice(2).replace(matchStatus, '"$1":')
|
|
8465
|
+
)) {
|
|
8466
8466
|
let schema = TypeBox(route.replaceAll(/readonly/g, ""));
|
|
8467
8467
|
if (schema.type !== "object") continue;
|
|
8468
8468
|
const paths = [];
|
package/dist/cjs/index.js
CHANGED
|
@@ -629,7 +629,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
629
629
|
const { type, description, $ref, ...options } = unwrapReference(response, definitions);
|
|
630
630
|
operation.responses[status] = {
|
|
631
631
|
description: description ?? `Response for status ${status}`,
|
|
632
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
632
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
633
633
|
"text/plain": {
|
|
634
634
|
schema: response
|
|
635
635
|
}
|
|
@@ -651,7 +651,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
651
651
|
const type = _type;
|
|
652
652
|
operation.responses["200"] = {
|
|
653
653
|
description: description ?? `Response for status 200`,
|
|
654
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
654
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
655
655
|
"text/plain": {
|
|
656
656
|
schema: response
|
|
657
657
|
}
|
package/dist/cjs/openapi.js
CHANGED
|
@@ -372,7 +372,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
372
372
|
const { type, description, $ref, ...options } = unwrapReference(response, definitions);
|
|
373
373
|
operation.responses[status] = {
|
|
374
374
|
description: description ?? `Response for status ${status}`,
|
|
375
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
375
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
376
376
|
"text/plain": {
|
|
377
377
|
schema: response
|
|
378
378
|
}
|
|
@@ -394,7 +394,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
394
394
|
const type = _type;
|
|
395
395
|
operation.responses["200"] = {
|
|
396
396
|
description: description ?? `Response for status 200`,
|
|
397
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
397
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
398
398
|
"text/plain": {
|
|
399
399
|
schema: response
|
|
400
400
|
}
|
package/dist/gen/index.mjs
CHANGED
|
@@ -8312,7 +8312,9 @@ function extractRootObjects(code) {
|
|
|
8312
8312
|
let keyEnd = colonIdx - 1;
|
|
8313
8313
|
while (keyEnd >= 0 && /\s/.test(code[keyEnd])) keyEnd--;
|
|
8314
8314
|
let keyStart = keyEnd;
|
|
8315
|
-
while (keyStart >= 0 &&
|
|
8315
|
+
while (keyStart >= 0 && !/[\s{};,\n]/.test(code[keyStart])) {
|
|
8316
|
+
keyStart--;
|
|
8317
|
+
}
|
|
8316
8318
|
const braceIdx = code.indexOf("{", colonIdx);
|
|
8317
8319
|
if (braceIdx === -1) break;
|
|
8318
8320
|
let depth = 0;
|
|
@@ -8446,12 +8448,10 @@ var fromTypes = (targetFilePath, {
|
|
|
8446
8448
|
3
|
|
8447
8449
|
)
|
|
8448
8450
|
);
|
|
8449
|
-
const routesString = extractRootObjects(instance)[0].replace(
|
|
8450
|
-
matchStatus,
|
|
8451
|
-
'"$1":'
|
|
8452
|
-
);
|
|
8453
8451
|
const routes = {};
|
|
8454
|
-
for (const route of extractRootObjects(
|
|
8452
|
+
for (const route of extractRootObjects(
|
|
8453
|
+
instance.slice(2).replace(matchStatus, '"$1":')
|
|
8454
|
+
)) {
|
|
8455
8455
|
let schema = TypeBox(route.replaceAll(/readonly/g, ""));
|
|
8456
8456
|
if (schema.type !== "object") continue;
|
|
8457
8457
|
const paths = [];
|
package/dist/index.mjs
CHANGED
|
@@ -602,7 +602,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
602
602
|
const { type, description, $ref, ...options } = unwrapReference(response, definitions);
|
|
603
603
|
operation.responses[status] = {
|
|
604
604
|
description: description ?? `Response for status ${status}`,
|
|
605
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
605
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
606
606
|
"text/plain": {
|
|
607
607
|
schema: response
|
|
608
608
|
}
|
|
@@ -624,7 +624,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
624
624
|
const type = _type;
|
|
625
625
|
operation.responses["200"] = {
|
|
626
626
|
description: description ?? `Response for status 200`,
|
|
627
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
627
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
628
628
|
"text/plain": {
|
|
629
629
|
schema: response
|
|
630
630
|
}
|
package/dist/openapi.mjs
CHANGED
|
@@ -343,7 +343,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
343
343
|
const { type, description, $ref, ...options } = unwrapReference(response, definitions);
|
|
344
344
|
operation.responses[status] = {
|
|
345
345
|
description: description ?? `Response for status ${status}`,
|
|
346
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
346
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
347
347
|
"text/plain": {
|
|
348
348
|
schema: response
|
|
349
349
|
}
|
|
@@ -365,7 +365,7 @@ function toOpenAPISchema(app, exclude, references, vendors) {
|
|
|
365
365
|
const type = _type;
|
|
366
366
|
operation.responses["200"] = {
|
|
367
367
|
description: description ?? `Response for status 200`,
|
|
368
|
-
content: type === "void" || type === "null" || type === "undefined" ?
|
|
368
|
+
content: type === "void" || type === "null" || type === "undefined" ? { type, description } : type === "string" || type === "number" || type === "integer" || type === "boolean" ? {
|
|
369
369
|
"text/plain": {
|
|
370
370
|
schema: response
|
|
371
371
|
}
|