hono-openapi 1.0.2 → 1.0.4
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 +2 -5
- package/dist/index.js +2 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ const toOpenAPIPath = (path) => path.split("/").map((x) => {
|
|
|
32
32
|
}).join("/");
|
|
33
33
|
const capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
34
34
|
const generateOperationId = (route) => {
|
|
35
|
-
let operationId = route.method;
|
|
35
|
+
let operationId = route.method.toLowerCase();
|
|
36
36
|
if (route.path === "/") return `${operationId}Index`;
|
|
37
37
|
for (const segment of route.path.split("/")) {
|
|
38
38
|
if (segment.charCodeAt(0) === 123) {
|
|
@@ -319,10 +319,7 @@ async function getSpec(middlewareHandler, defaultOptions) {
|
|
|
319
319
|
const result2 = await raw.schema.toOpenAPISchema();
|
|
320
320
|
raw.schema = result2.schema;
|
|
321
321
|
if (result2.components) {
|
|
322
|
-
components =
|
|
323
|
-
...components,
|
|
324
|
-
...result2.components
|
|
325
|
-
};
|
|
322
|
+
components = mergeComponentsObjects(components, result2.components);
|
|
326
323
|
}
|
|
327
324
|
}
|
|
328
325
|
}
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ const toOpenAPIPath = (path) => path.split("/").map((x) => {
|
|
|
30
30
|
}).join("/");
|
|
31
31
|
const capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
32
32
|
const generateOperationId = (route) => {
|
|
33
|
-
let operationId = route.method;
|
|
33
|
+
let operationId = route.method.toLowerCase();
|
|
34
34
|
if (route.path === "/") return `${operationId}Index`;
|
|
35
35
|
for (const segment of route.path.split("/")) {
|
|
36
36
|
if (segment.charCodeAt(0) === 123) {
|
|
@@ -317,10 +317,7 @@ async function getSpec(middlewareHandler, defaultOptions) {
|
|
|
317
317
|
const result2 = await raw.schema.toOpenAPISchema();
|
|
318
318
|
raw.schema = result2.schema;
|
|
319
319
|
if (result2.components) {
|
|
320
|
-
components =
|
|
321
|
-
...components,
|
|
322
|
-
...result2.components
|
|
323
|
-
};
|
|
320
|
+
components = mergeComponentsObjects(components, result2.components);
|
|
324
321
|
}
|
|
325
322
|
}
|
|
326
323
|
}
|