@microsoft/m365-spec-parser 0.2.2-alpha.7d5be6034.0 → 0.2.2-alpha.9389d4dc7.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.node.cjs.js
CHANGED
|
@@ -302,23 +302,28 @@ class Utils {
|
|
|
302
302
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
303
303
|
}
|
|
304
304
|
static getResponseJson(operationObject, allowMultipleMediaType = false) {
|
|
305
|
-
var _a
|
|
305
|
+
var _a;
|
|
306
306
|
let json = {};
|
|
307
307
|
let multipleMediaType = false;
|
|
308
308
|
for (const code of ConstantString.ResponseCodeFor20X) {
|
|
309
309
|
const responseObject = (_a = operationObject === null || operationObject === void 0 ? void 0 : operationObject.responses) === null || _a === void 0 ? void 0 : _a[code];
|
|
310
|
-
if (
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
310
|
+
if (responseObject === null || responseObject === void 0 ? void 0 : responseObject.content) {
|
|
311
|
+
for (const contentType of Object.keys(responseObject.content)) {
|
|
312
|
+
// json media type can also be "application/json; charset=utf-8"
|
|
313
|
+
if (contentType.indexOf("application/json") >= 0) {
|
|
314
|
+
multipleMediaType = false;
|
|
315
|
+
json = responseObject.content[contentType];
|
|
316
|
+
if (Utils.containMultipleMediaTypes(responseObject)) {
|
|
317
|
+
multipleMediaType = true;
|
|
318
|
+
if (!allowMultipleMediaType) {
|
|
319
|
+
json = {};
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
return { json, multipleMediaType };
|
|
324
|
+
}
|
|
317
325
|
}
|
|
318
326
|
}
|
|
319
|
-
else {
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
327
|
}
|
|
323
328
|
}
|
|
324
329
|
return { json, multipleMediaType };
|
|
@@ -592,10 +597,11 @@ class Utils {
|
|
|
592
597
|
currentCount += items.length;
|
|
593
598
|
}
|
|
594
599
|
else {
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
600
|
+
result.push(element);
|
|
601
|
+
currentCount++;
|
|
602
|
+
}
|
|
603
|
+
if (currentCount >= maxCount) {
|
|
604
|
+
break;
|
|
599
605
|
}
|
|
600
606
|
}
|
|
601
607
|
return result;
|