@kubb/adapter-oas 5.15.0 → 5.15.1
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 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ var compatibility = {
|
|
|
35
35
|
"node": ">=22.22"
|
|
36
36
|
};
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "5.15.
|
|
38
|
+
var version = "5.15.1";
|
|
39
39
|
// src/constants.ts
|
|
40
40
|
/**
|
|
41
41
|
* Default parser options applied when no explicit options are provided.
|
|
@@ -2939,7 +2939,7 @@ const adapterOas = (0, _kubb_core.defineExtension)({
|
|
|
2939
2939
|
function parseInput({ document, refs, schemas, pointers, parseSchema }) {
|
|
2940
2940
|
const parsedByName = /* @__PURE__ */ new Map();
|
|
2941
2941
|
const refAliasMap = /* @__PURE__ */ new Map();
|
|
2942
|
-
const enumNames =
|
|
2942
|
+
const enumNames = /* @__PURE__ */ new Set();
|
|
2943
2943
|
const discriminatorParentNodes = [];
|
|
2944
2944
|
for (const [name, schema] of Object.entries(schemas)) {
|
|
2945
2945
|
const node = {
|
|
@@ -2952,10 +2952,10 @@ const adapterOas = (0, _kubb_core.defineExtension)({
|
|
|
2952
2952
|
parsedByName.set(name, node);
|
|
2953
2953
|
scanSchema(node);
|
|
2954
2954
|
if (node.type === "ref" && node.name) refAliasMap.set(name, node);
|
|
2955
|
-
if (_kubb_kit.ast.narrowSchema(node, "enum") && node.name) enumNames.
|
|
2955
|
+
if (_kubb_kit.ast.narrowSchema(node, "enum") && node.name) enumNames.add(node.name);
|
|
2956
2956
|
if (discriminator === "propagate" && (schema.oneOf ?? schema.anyOf) && schema.discriminator?.propertyName) discriminatorParentNodes.push(node);
|
|
2957
2957
|
}
|
|
2958
|
-
const circularNames =
|
|
2958
|
+
const circularNames = _kubb_kit.ast.findCircularSchemas([...parsedByName.values()]);
|
|
2959
2959
|
const discriminatorChildMap = discriminatorParentNodes.length > 0 ? buildDiscriminatorChildMap(discriminatorParentNodes) : null;
|
|
2960
2960
|
const operationNodes = getOperations(document, refs).map((operation) => parseOperation({
|
|
2961
2961
|
operation,
|
|
@@ -2965,7 +2965,7 @@ const adapterOas = (0, _kubb_core.defineExtension)({
|
|
|
2965
2965
|
parseSchema
|
|
2966
2966
|
}));
|
|
2967
2967
|
const promotedEnums = enums === "root" ? collectInlineEnums([...parsedByName.values(), ...operationNodes], new Set(Object.keys(schemas))) : null;
|
|
2968
|
-
if (promotedEnums) for (const name of promotedEnums.keys()) enumNames.
|
|
2968
|
+
if (promotedEnums) for (const name of promotedEnums.keys()) enumNames.add(name);
|
|
2969
2969
|
const aliasTargetOf = (name) => {
|
|
2970
2970
|
const node = refAliasMap.get(name);
|
|
2971
2971
|
return node?.ref ? _kubb_kit.ast.refName(node.ref) : node?.name;
|