@microsoft/m365-spec-parser 0.2.2-alpha.8020c3125.0 → 0.2.2-alpha.882a28541.0
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.esm2017.js +21 -15
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +21 -15
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +21 -15
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +21 -15
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +3 -3
package/dist/index.esm2017.mjs
CHANGED
|
@@ -260,23 +260,28 @@ class Utils {
|
|
|
260
260
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
261
261
|
}
|
|
262
262
|
static getResponseJson(operationObject, allowMultipleMediaType = false) {
|
|
263
|
-
var _a
|
|
263
|
+
var _a;
|
|
264
264
|
let json = {};
|
|
265
265
|
let multipleMediaType = false;
|
|
266
266
|
for (const code of ConstantString.ResponseCodeFor20X) {
|
|
267
267
|
const responseObject = (_a = operationObject === null || operationObject === void 0 ? void 0 : operationObject.responses) === null || _a === void 0 ? void 0 : _a[code];
|
|
268
|
-
if (
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
268
|
+
if (responseObject === null || responseObject === void 0 ? void 0 : responseObject.content) {
|
|
269
|
+
for (const contentType of Object.keys(responseObject.content)) {
|
|
270
|
+
// json media type can also be "application/json; charset=utf-8"
|
|
271
|
+
if (contentType.indexOf("application/json") >= 0) {
|
|
272
|
+
multipleMediaType = false;
|
|
273
|
+
json = responseObject.content[contentType];
|
|
274
|
+
if (Utils.containMultipleMediaTypes(responseObject)) {
|
|
275
|
+
multipleMediaType = true;
|
|
276
|
+
if (!allowMultipleMediaType) {
|
|
277
|
+
json = {};
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
return { json, multipleMediaType };
|
|
282
|
+
}
|
|
275
283
|
}
|
|
276
284
|
}
|
|
277
|
-
else {
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
285
|
}
|
|
281
286
|
}
|
|
282
287
|
return { json, multipleMediaType };
|
|
@@ -550,10 +555,11 @@ class Utils {
|
|
|
550
555
|
currentCount += items.length;
|
|
551
556
|
}
|
|
552
557
|
else {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
558
|
+
result.push(element);
|
|
559
|
+
currentCount++;
|
|
560
|
+
}
|
|
561
|
+
if (currentCount >= maxCount) {
|
|
562
|
+
break;
|
|
557
563
|
}
|
|
558
564
|
}
|
|
559
565
|
return result;
|