@samchon/openapi
Advanced tools
Comparing version 0.1.2-dev.20240411-5 to 0.1.2-dev.20240411-6
@@ -56,3 +56,5 @@ "use strict"; | ||
: (_e = (_d = doc.components) === null || _d === void 0 ? void 0 : _d.parameters) === null || _e === void 0 ? void 0 : _e[(_f = p.$ref.split("/").pop()) !== null && _f !== void 0 ? _f : ""]; | ||
return found !== undefined ? convertParameter(found) : undefined; | ||
return found !== undefined | ||
? convertParameter(Object.assign(Object.assign({}, found), { in: "header" })) | ||
: undefined; | ||
}) | ||
@@ -95,3 +97,3 @@ .filter((_, v) => v !== undefined), requestBody: input.requestBody | ||
if (TypeChecker.isReference(value) === false) | ||
return convertParameter(value); | ||
return convertParameter(Object.assign(Object.assign({}, value), { in: "header" })); | ||
const found = value.$ref.startsWith("#/components/headers/") | ||
@@ -101,3 +103,3 @@ ? (_b = (_a = doc.components) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b[(_c = value.$ref.split("/").pop()) !== null && _c !== void 0 ? _c : ""] | ||
return found !== undefined | ||
? convertParameter(found) | ||
? convertParameter(Object.assign(Object.assign({}, found), { in: "header" })) | ||
: undefined; | ||
@@ -104,0 +106,0 @@ })(), |
@@ -44,3 +44,5 @@ "use strict"; | ||
: (_e = (_d = doc.components) === null || _d === void 0 ? void 0 : _d.parameters) === null || _e === void 0 ? void 0 : _e[(_f = p.$ref.split("/").pop()) !== null && _f !== void 0 ? _f : ""]; | ||
return found !== undefined ? convertParameter(found) : undefined; | ||
return found !== undefined | ||
? convertParameter(Object.assign(Object.assign({}, found), { in: "header" })) | ||
: undefined; | ||
}) | ||
@@ -83,3 +85,3 @@ .filter((_, v) => v !== undefined), requestBody: input.requestBody | ||
if (TypeChecker.isReference(value) === false) | ||
return convertParameter(value); | ||
return convertParameter(Object.assign(Object.assign({}, value), { in: "header" })); | ||
const found = value.$ref.startsWith("#/components/headers/") | ||
@@ -89,3 +91,3 @@ ? (_b = (_a = doc.components) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b[(_c = value.$ref.split("/").pop()) !== null && _c !== void 0 ? _c : ""] | ||
return found !== undefined | ||
? convertParameter(found) | ||
? convertParameter(Object.assign(Object.assign({}, found), { in: "header" })) | ||
: undefined; | ||
@@ -92,0 +94,0 @@ })(), |
@@ -92,3 +92,3 @@ /** | ||
content?: Record<string, IMediaType>; | ||
headers?: Record<string, IOperation.IParameter | IJsonSchema.IReference<`#/components/headers/${string}`>>; | ||
headers?: Record<string, Omit<IOperation.IParameter, "in"> | IJsonSchema.IReference<`#/components/headers/${string}`>>; | ||
description?: string; | ||
@@ -107,3 +107,3 @@ } | ||
securitySchemes?: Record<string, ISecurityScheme>; | ||
headers?: Record<string, IOperation.IParameter>; | ||
headers?: Record<string, Omit<IOperation.IParameter, "in">>; | ||
} | ||
@@ -110,0 +110,0 @@ type IJsonSchema = IJsonSchema.IMixed | IJsonSchema.IConstant | IJsonSchema.IBoolean | IJsonSchema.IInteger | IJsonSchema.INumber | IJsonSchema.IString | IJsonSchema.IArray | IJsonSchema.IObject | IJsonSchema.IReference | IJsonSchema.IUnknown | IJsonSchema.INull | IJsonSchema.IAllOf | IJsonSchema.IAnyOf | IJsonSchema.IOneOf; |
@@ -89,3 +89,3 @@ /** | ||
content?: Record<string, IMediaType>; | ||
headers?: Record<string, IOperation.IParameter | IJsonSchema.IReference<`#/components/headers/${string}`>>; | ||
headers?: Record<string, Omit<IOperation.IParameter, "in"> | IJsonSchema.IReference<`#/components/headers/${string}`>>; | ||
description?: string; | ||
@@ -103,3 +103,3 @@ } | ||
securitySchemes?: Record<string, ISecurityScheme>; | ||
headers?: Record<string, IOperation.IParameter>; | ||
headers?: Record<string, Omit<IOperation.IParameter, "in">>; | ||
} | ||
@@ -106,0 +106,0 @@ type IJsonSchema = IJsonSchema.IBoolean | IJsonSchema.IInteger | IJsonSchema.INumber | IJsonSchema.IString | IJsonSchema.IArray | IJsonSchema.IObject | IJsonSchema.IReference | IJsonSchema.IUnknown | IJsonSchema.INullOnly | IJsonSchema.IAllOf | IJsonSchema.IAnyOf | IJsonSchema.IOneOf; |
{ | ||
"name": "@samchon/openapi", | ||
"version": "0.1.2-dev.20240411-5", | ||
"version": "0.1.2-dev.20240411-6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -82,7 +82,13 @@ import { OpenApi } from "../OpenApi"; | ||
if (!TypeChecker.isReference(p)) return convertParameter(p); | ||
const found: OpenApiV3_1.IOperation.IParameter | undefined = | ||
p.$ref.startsWith("#/components/headers/") | ||
? doc.components?.headers?.[p.$ref.split("/").pop() ?? ""] | ||
: doc.components?.parameters?.[p.$ref.split("/").pop() ?? ""]; | ||
return found !== undefined ? convertParameter(found) : undefined!; | ||
const found: | ||
| Omit<OpenApiV3_1.IOperation.IParameter, "in"> | ||
| undefined = p.$ref.startsWith("#/components/headers/") | ||
? doc.components?.headers?.[p.$ref.split("/").pop() ?? ""] | ||
: doc.components?.parameters?.[p.$ref.split("/").pop() ?? ""]; | ||
return found !== undefined | ||
? convertParameter({ | ||
...found, | ||
in: "header", | ||
}) | ||
: undefined!; | ||
}) | ||
@@ -154,5 +160,8 @@ .filter((_, v) => v !== undefined), | ||
if (TypeChecker.isReference(value) === false) | ||
return convertParameter(value); | ||
return convertParameter({ | ||
...value, | ||
in: "header", | ||
}); | ||
const found: | ||
| OpenApiV3_1.IOperation.IParameter | ||
| Omit<OpenApiV3_1.IOperation.IParameter, "in"> | ||
| undefined = value.$ref.startsWith( | ||
@@ -166,3 +175,3 @@ "#/components/headers/", | ||
return found !== undefined | ||
? convertParameter(found) | ||
? convertParameter({ ...found, in: "header" }) | ||
: undefined!; | ||
@@ -169,0 +178,0 @@ })(), |
@@ -60,7 +60,12 @@ import { OpenApi } from "../OpenApi"; | ||
if (!TypeChecker.isReference(p)) return convertParameter(p); | ||
const found: OpenApiV3.IOperation.IParameter | undefined = | ||
const found: Omit<OpenApiV3.IOperation.IParameter, "in"> | undefined = | ||
p.$ref.startsWith("#/components/headers/") | ||
? doc.components?.headers?.[p.$ref.split("/").pop() ?? ""] | ||
: doc.components?.parameters?.[p.$ref.split("/").pop() ?? ""]; | ||
return found !== undefined ? convertParameter(found) : undefined!; | ||
return found !== undefined | ||
? convertParameter({ | ||
...found, | ||
in: "header", | ||
}) | ||
: undefined!; | ||
}) | ||
@@ -132,5 +137,8 @@ .filter((_, v) => v !== undefined), | ||
if (TypeChecker.isReference(value) === false) | ||
return convertParameter(value); | ||
return convertParameter({ | ||
...value, | ||
in: "header", | ||
}); | ||
const found: | ||
| OpenApiV3.IOperation.IParameter | ||
| Omit<OpenApiV3.IOperation.IParameter, "in"> | ||
| undefined = value.$ref.startsWith( | ||
@@ -144,3 +152,6 @@ "#/components/headers/", | ||
return found !== undefined | ||
? convertParameter(found) | ||
? convertParameter({ | ||
...found, | ||
in: "header", | ||
}) | ||
: undefined!; | ||
@@ -147,0 +158,0 @@ })(), |
@@ -134,3 +134,3 @@ /** | ||
string, | ||
| IOperation.IParameter | ||
| Omit<IOperation.IParameter, "in"> | ||
| IJsonSchema.IReference<`#/components/headers/${string}`> | ||
@@ -155,3 +155,3 @@ >; | ||
securitySchemes?: Record<string, ISecurityScheme>; | ||
headers?: Record<string, IOperation.IParameter>; | ||
headers?: Record<string, Omit<IOperation.IParameter, "in">>; | ||
} | ||
@@ -158,0 +158,0 @@ |
@@ -128,3 +128,3 @@ /** | ||
string, | ||
| IOperation.IParameter | ||
| Omit<IOperation.IParameter, "in"> | ||
| IJsonSchema.IReference<`#/components/headers/${string}`> | ||
@@ -148,3 +148,3 @@ >; | ||
securitySchemes?: Record<string, ISecurityScheme>; | ||
headers?: Record<string, IOperation.IParameter>; | ||
headers?: Record<string, Omit<IOperation.IParameter, "in">>; | ||
} | ||
@@ -151,0 +151,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155979
4068