@ng-openapi/http-resource 0.0.18 → 0.0.19
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/index.cjs +5 -1
- package/index.js +5 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -100,6 +100,10 @@ function getTypeScriptType(schemaOrType, config, formatOrNullable, isNullable, c
|
|
|
100
100
|
case "null":
|
|
101
101
|
return "null";
|
|
102
102
|
default:
|
|
103
|
+
if (Array.isArray(schema2.type)) {
|
|
104
|
+
const types = schema2.type.map((t) => getTypeScriptType(t, config, void 0, void 0, context));
|
|
105
|
+
return nullableType(types.join(" | "), nullable);
|
|
106
|
+
}
|
|
103
107
|
return nullableType("any", nullable);
|
|
104
108
|
}
|
|
105
109
|
}
|
|
@@ -281,7 +285,7 @@ function inferResponseTypeFromContentType(contentType) {
|
|
|
281
285
|
}
|
|
282
286
|
return "text";
|
|
283
287
|
}
|
|
284
|
-
if (normalizedType === "
|
|
288
|
+
if (normalizedType === "CONTENT_TYPES.FORM_URLENCODED" || normalizedType === "multipart/form-data") {
|
|
285
289
|
return "text";
|
|
286
290
|
}
|
|
287
291
|
if (normalizedType === "application/javascript" || normalizedType === "application/typescript" || normalizedType === "application/css" || normalizedType === "application/yaml" || normalizedType === "application/x-yaml" || normalizedType === "application/toml") {
|
package/index.js
CHANGED
|
@@ -66,6 +66,10 @@ function getTypeScriptType(schemaOrType, config, formatOrNullable, isNullable, c
|
|
|
66
66
|
case "null":
|
|
67
67
|
return "null";
|
|
68
68
|
default:
|
|
69
|
+
if (Array.isArray(schema2.type)) {
|
|
70
|
+
const types = schema2.type.map((t) => getTypeScriptType(t, config, void 0, void 0, context));
|
|
71
|
+
return nullableType(types.join(" | "), nullable);
|
|
72
|
+
}
|
|
69
73
|
return nullableType("any", nullable);
|
|
70
74
|
}
|
|
71
75
|
}
|
|
@@ -247,7 +251,7 @@ function inferResponseTypeFromContentType(contentType) {
|
|
|
247
251
|
}
|
|
248
252
|
return "text";
|
|
249
253
|
}
|
|
250
|
-
if (normalizedType === "
|
|
254
|
+
if (normalizedType === "CONTENT_TYPES.FORM_URLENCODED" || normalizedType === "multipart/form-data") {
|
|
251
255
|
return "text";
|
|
252
256
|
}
|
|
253
257
|
if (normalizedType === "application/javascript" || normalizedType === "application/typescript" || normalizedType === "application/css" || normalizedType === "application/yaml" || normalizedType === "application/x-yaml" || normalizedType === "application/toml") {
|