Merge branch 'develop' into fix496/validateWithServers

This commit is contained in:
Luis Tejeda
2022-07-18 12:42:13 -05:00
16 changed files with 672 additions and 48 deletions

View File

@@ -1827,6 +1827,10 @@ module.exports = {
bodyData = this.convertToPmBodyData(contentObj[FORM_DATA], requestType, FORM_DATA,
PARAMETER_SOURCE.REQUEST, options.indentCharacter, components, options, schemaCache);
encoding = contentObj[FORM_DATA].encoding ? contentObj[FORM_DATA].encoding : {};
if (contentObj[FORM_DATA].hasOwnProperty('schema') && contentObj[FORM_DATA].schema.hasOwnProperty('$ref')) {
contentObj[FORM_DATA].schema = this.getRefObject(contentObj[FORM_DATA].schema.$ref, components, options);
}
// create the form parameters and add it to the request body object
_.forOwn(bodyData, (value, key) => {
@@ -2454,9 +2458,6 @@ module.exports = {
pmBody = this.convertToPmBody(reqBody, REQUEST_TYPE.ROOT, components, options, schemaCache);
item.request.body = pmBody.body;
// Following is added to make sure body pruning for request methods like GET, HEAD etc is disabled'.
item.protocolProfileBehavior = { disableBodyPruning: true };
if (!options.keepImplicitHeaders || (!_.find(reqParams.header, (h) => {
return _.toLower(_.get(h, 'name')) === 'content-type';
}))) {
@@ -2568,6 +2569,13 @@ module.exports = {
if (!_.isEmpty(acceptHeader) && !item.request.headers.has('accept')) {
item.request.addHeader(acceptHeader);
}
/**
* Following is added to make sure body pruning for request methods like GET, HEAD etc is disabled'.
* https://github.com/postmanlabs/postman-runtime/blob/develop/docs/protocol-profile-behavior.md
*/
item.protocolProfileBehavior = { disableBodyPruning: true };
return item;
},