@kubb/adapter-oas 5.9.4 → 5.9.5
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 +32 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -12,7 +12,7 @@ var compatibility = {
|
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region package.json
|
|
15
|
-
var version = "5.9.
|
|
15
|
+
var version = "5.9.5";
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/constants.ts
|
|
18
18
|
/**
|
|
@@ -2252,6 +2252,9 @@ const adapterOas = (0, _kubb_kit.defineExtension)({
|
|
|
2252
2252
|
build({ validate, contentType, server, discriminator, enums, ...parserOptions }) {
|
|
2253
2253
|
let parsedDocument = null;
|
|
2254
2254
|
const inputCache = /* @__PURE__ */ new WeakMap();
|
|
2255
|
+
/**
|
|
2256
|
+
* Parses every schema and operation once, resolving ref aliases and discriminator children from that same pass.
|
|
2257
|
+
*/
|
|
2255
2258
|
function parseInput({ document, refs, schemas, parseSchema }) {
|
|
2256
2259
|
const parsedByName = /* @__PURE__ */ new Map();
|
|
2257
2260
|
const refAliasMap = /* @__PURE__ */ new Map();
|
|
@@ -2307,6 +2310,34 @@ const adapterOas = (0, _kubb_kit.defineExtension)({
|
|
|
2307
2310
|
document,
|
|
2308
2311
|
server
|
|
2309
2312
|
}),
|
|
2313
|
+
servers: (document.servers ?? []).filter((entry) => entry.url).map(({ url, description, variables }) => {
|
|
2314
|
+
try {
|
|
2315
|
+
return {
|
|
2316
|
+
url: resolveServerUrl({
|
|
2317
|
+
url,
|
|
2318
|
+
variables
|
|
2319
|
+
}),
|
|
2320
|
+
description
|
|
2321
|
+
};
|
|
2322
|
+
} catch {
|
|
2323
|
+
return {
|
|
2324
|
+
url,
|
|
2325
|
+
description
|
|
2326
|
+
};
|
|
2327
|
+
}
|
|
2328
|
+
}),
|
|
2329
|
+
securitySchemes: Object.entries(document.components?.securitySchemes ?? {}).flatMap(([name, value]) => {
|
|
2330
|
+
const scheme = refs.deref(value);
|
|
2331
|
+
return scheme?.type ? [{
|
|
2332
|
+
name,
|
|
2333
|
+
type: scheme.type,
|
|
2334
|
+
description: scheme.description,
|
|
2335
|
+
scheme: scheme.scheme,
|
|
2336
|
+
bearerFormat: scheme.bearerFormat,
|
|
2337
|
+
in: scheme.in,
|
|
2338
|
+
parameterName: scheme.name
|
|
2339
|
+
}] : [];
|
|
2340
|
+
}),
|
|
2310
2341
|
circularNames,
|
|
2311
2342
|
enumNames
|
|
2312
2343
|
}
|