@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.js
CHANGED
|
@@ -2383,9 +2383,10 @@ function preScan({ schemas, parseSchema, parseOperation, baseOas, parserOptions,
|
|
|
2383
2383
|
});
|
|
2384
2384
|
for (const definition of dedupePlan.hoisted) if (definition.type === "enum" && definition.name) enumNames.push(definition.name);
|
|
2385
2385
|
}
|
|
2386
|
+
const aliasNames = dedupePlan?.aliasNames;
|
|
2386
2387
|
return {
|
|
2387
2388
|
refAliasMap,
|
|
2388
|
-
enumNames,
|
|
2389
|
+
enumNames: aliasNames && aliasNames.size > 0 ? enumNames.filter((name) => !aliasNames.has(name)) : enumNames,
|
|
2389
2390
|
circularNames,
|
|
2390
2391
|
discriminatorChildMap,
|
|
2391
2392
|
dedupePlan
|
|
@@ -2420,12 +2421,13 @@ function createInputStream({ schemas, parseSchema, parseOperation, baseOas, pars
|
|
|
2420
2421
|
description: node.description,
|
|
2421
2422
|
deprecated: node.deprecated
|
|
2422
2423
|
});
|
|
2423
|
-
return ast.applyDedupe(node, dedupePlan
|
|
2424
|
+
return ast.applyDedupe(node, dedupePlan, true);
|
|
2424
2425
|
};
|
|
2425
2426
|
const schemasIterable = { [Symbol.asyncIterator]() {
|
|
2426
2427
|
return (async function* () {
|
|
2427
2428
|
if (dedupePlan) for (const definition of dedupePlan.hoisted) yield definition;
|
|
2428
2429
|
for (const [name, schema] of Object.entries(schemas)) {
|
|
2430
|
+
if (dedupePlan?.aliasNames.has(name)) continue;
|
|
2429
2431
|
const alias = refAliasMap.get(name);
|
|
2430
2432
|
if (alias?.name && schemas[alias.name]) {
|
|
2431
2433
|
yield rewriteTopLevelSchema({
|
|
@@ -2450,7 +2452,7 @@ function createInputStream({ schemas, parseSchema, parseOperation, baseOas, pars
|
|
|
2450
2452
|
for (const methods of Object.values(baseOas.getPaths())) for (const operation of Object.values(methods)) {
|
|
2451
2453
|
if (!operation) continue;
|
|
2452
2454
|
const node = parseOperation(parserOptions, operation);
|
|
2453
|
-
if (node) yield dedupePlan ? ast.applyDedupe(node, dedupePlan
|
|
2455
|
+
if (node) yield dedupePlan ? ast.applyDedupe(node, dedupePlan) : node;
|
|
2454
2456
|
}
|
|
2455
2457
|
})();
|
|
2456
2458
|
} };
|