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