@kubb/adapter-oas 5.0.0-beta.53 → 5.0.0-beta.54
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 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/stream.ts +13 -3
package/dist/index.cjs
CHANGED
|
@@ -2409,9 +2409,10 @@ function preScan({ schemas, parseSchema, parseOperation, baseOas, parserOptions,
|
|
|
2409
2409
|
});
|
|
2410
2410
|
for (const definition of dedupePlan.hoisted) if (definition.type === "enum" && definition.name) enumNames.push(definition.name);
|
|
2411
2411
|
}
|
|
2412
|
+
const aliasNames = dedupePlan?.aliasNames;
|
|
2412
2413
|
return {
|
|
2413
2414
|
refAliasMap,
|
|
2414
|
-
enumNames,
|
|
2415
|
+
enumNames: aliasNames && aliasNames.size > 0 ? enumNames.filter((name) => !aliasNames.has(name)) : enumNames,
|
|
2415
2416
|
circularNames,
|
|
2416
2417
|
discriminatorChildMap,
|
|
2417
2418
|
dedupePlan
|
|
@@ -2446,12 +2447,13 @@ function createInputStream({ schemas, parseSchema, parseOperation, baseOas, pars
|
|
|
2446
2447
|
description: node.description,
|
|
2447
2448
|
deprecated: node.deprecated
|
|
2448
2449
|
});
|
|
2449
|
-
return _kubb_core.ast.applyDedupe(node, dedupePlan
|
|
2450
|
+
return _kubb_core.ast.applyDedupe(node, dedupePlan, true);
|
|
2450
2451
|
};
|
|
2451
2452
|
const schemasIterable = { [Symbol.asyncIterator]() {
|
|
2452
2453
|
return (async function* () {
|
|
2453
2454
|
if (dedupePlan) for (const definition of dedupePlan.hoisted) yield definition;
|
|
2454
2455
|
for (const [name, schema] of Object.entries(schemas)) {
|
|
2456
|
+
if (dedupePlan?.aliasNames.has(name)) continue;
|
|
2455
2457
|
const alias = refAliasMap.get(name);
|
|
2456
2458
|
if (alias?.name && schemas[alias.name]) {
|
|
2457
2459
|
yield rewriteTopLevelSchema({
|
|
@@ -2476,7 +2478,7 @@ function createInputStream({ schemas, parseSchema, parseOperation, baseOas, pars
|
|
|
2476
2478
|
for (const methods of Object.values(baseOas.getPaths())) for (const operation of Object.values(methods)) {
|
|
2477
2479
|
if (!operation) continue;
|
|
2478
2480
|
const node = parseOperation(parserOptions, operation);
|
|
2479
|
-
if (node) yield dedupePlan ? _kubb_core.ast.applyDedupe(node, dedupePlan
|
|
2481
|
+
if (node) yield dedupePlan ? _kubb_core.ast.applyDedupe(node, dedupePlan) : node;
|
|
2480
2482
|
}
|
|
2481
2483
|
})();
|
|
2482
2484
|
} };
|