@kubb/adapter-oas 5.9.6 → 5.10.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 +17 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -5
- 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.
|
|
14
|
+
var version = "5.10.1";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/constants.ts
|
|
17
17
|
/**
|
|
@@ -534,6 +534,13 @@ function isNullable(schema) {
|
|
|
534
534
|
return false;
|
|
535
535
|
}
|
|
536
536
|
/**
|
|
537
|
+
* Returns the `x-*` keys of `source` as-is, or `undefined` when there are none.
|
|
538
|
+
*/
|
|
539
|
+
function pickExtensions(source) {
|
|
540
|
+
const entries = Object.entries(source).filter(([key]) => key.startsWith("x-"));
|
|
541
|
+
return entries.length > 0 ? Object.fromEntries(entries) : void 0;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
537
544
|
* Returns `true` when `obj` is an OpenAPI `$ref` pointer object.
|
|
538
545
|
*/
|
|
539
546
|
function isReference(obj) {
|
|
@@ -1004,7 +1011,8 @@ function parseOperation({ operation, ...ctx }) {
|
|
|
1004
1011
|
deprecated: operation.schema.deprecated || void 0,
|
|
1005
1012
|
parameters,
|
|
1006
1013
|
requestBody,
|
|
1007
|
-
responses
|
|
1014
|
+
responses,
|
|
1015
|
+
extensions: pickExtensions(operation.schema)
|
|
1008
1016
|
});
|
|
1009
1017
|
}
|
|
1010
1018
|
//#endregion
|
|
@@ -2337,18 +2345,21 @@ const adapterOas = defineExtension({
|
|
|
2337
2345
|
server
|
|
2338
2346
|
}),
|
|
2339
2347
|
servers: (document.servers ?? []).filter((entry) => entry.url).map(({ url, description, variables }) => {
|
|
2348
|
+
const declared = variables && Object.keys(variables).length > 0 ? { variables } : {};
|
|
2340
2349
|
try {
|
|
2341
2350
|
return {
|
|
2342
2351
|
url: resolveServerUrl({
|
|
2343
2352
|
url,
|
|
2344
2353
|
variables
|
|
2345
2354
|
}),
|
|
2346
|
-
description
|
|
2355
|
+
description,
|
|
2356
|
+
...declared
|
|
2347
2357
|
};
|
|
2348
2358
|
} catch {
|
|
2349
2359
|
return {
|
|
2350
2360
|
url,
|
|
2351
|
-
description
|
|
2361
|
+
description,
|
|
2362
|
+
...declared
|
|
2352
2363
|
};
|
|
2353
2364
|
}
|
|
2354
2365
|
}),
|
|
@@ -2365,7 +2376,8 @@ const adapterOas = defineExtension({
|
|
|
2365
2376
|
}] : [];
|
|
2366
2377
|
}),
|
|
2367
2378
|
circularNames,
|
|
2368
|
-
enumNames
|
|
2379
|
+
enumNames,
|
|
2380
|
+
extensions: pickExtensions(document)
|
|
2369
2381
|
}
|
|
2370
2382
|
});
|
|
2371
2383
|
}
|