@kubb/oas 4.12.1 → 4.12.3
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 +14 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/Oas.ts +30 -0
package/dist/index.js
CHANGED
|
@@ -4594,6 +4594,20 @@ var Oas = class extends BaseOas {
|
|
|
4594
4594
|
return params.reduce((schema$2, pathParameters) => {
|
|
4595
4595
|
const property = pathParameters.content?.[contentType]?.schema ?? pathParameters.schema;
|
|
4596
4596
|
const required = [...schema$2.required || [], pathParameters.required ? pathParameters.name : void 0].filter(Boolean);
|
|
4597
|
+
const getDefaultStyle = (location) => {
|
|
4598
|
+
if (location === "query") return "form";
|
|
4599
|
+
if (location === "path") return "simple";
|
|
4600
|
+
return "simple";
|
|
4601
|
+
};
|
|
4602
|
+
const style = pathParameters.style || getDefaultStyle(inKey);
|
|
4603
|
+
const explode = pathParameters.explode !== void 0 ? pathParameters.explode : style === "form";
|
|
4604
|
+
if (inKey === "query" && style === "form" && explode === true && property?.type === "object" && property?.additionalProperties && !property?.properties) return {
|
|
4605
|
+
...schema$2,
|
|
4606
|
+
description: pathParameters.description || schema$2.description,
|
|
4607
|
+
deprecated: schema$2.deprecated,
|
|
4608
|
+
example: property.example || schema$2.example,
|
|
4609
|
+
additionalProperties: property.additionalProperties
|
|
4610
|
+
};
|
|
4597
4611
|
return {
|
|
4598
4612
|
...schema$2,
|
|
4599
4613
|
description: schema$2.description,
|