mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
reduced openapi spec file
This commit is contained in:
14
lib/deref.js
14
lib/deref.js
@@ -164,19 +164,15 @@ module.exports = {
|
||||
continue;
|
||||
}
|
||||
/* eslint-enable */
|
||||
tempSchema.properties[prop] = property;
|
||||
// eslint-disable-next-line max-len
|
||||
tempSchema.properties[prop] = this.resolveRefs(tempSchema.properties[prop], bodyTypeOption, components, stack);
|
||||
tempSchema.properties[prop] = this.resolveRefs(property,
|
||||
bodyTypeOption, components, stack);
|
||||
}
|
||||
}
|
||||
return tempSchema;
|
||||
}
|
||||
/* eslint-disable no-else-return */
|
||||
else {
|
||||
schema.type = 'string';
|
||||
schema.default = '<object>';
|
||||
}
|
||||
/* eslint-enable */
|
||||
|
||||
schema.type = 'string';
|
||||
schema.default = '<object>';
|
||||
}
|
||||
else if (schema.type === 'array' && schema.items) {
|
||||
|
||||
|
||||
@@ -1135,8 +1135,8 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
bodyData = this.convertToPmBodyData(contentObj[bodyType], bodyType, BODY_TYPE.REQUEST, this.options.indentCharacter);
|
||||
bodyData = this.convertToPmBodyData(contentObj[bodyType], bodyType,
|
||||
BODY_TYPE.REQUEST, this.options.indentCharacter);
|
||||
|
||||
updateOptions = {
|
||||
mode: rDataMode,
|
||||
|
||||
@@ -21,17 +21,7 @@
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"readOnly": true
|
||||
},
|
||||
"tag": {
|
||||
"type": "string",
|
||||
"writeOnly": true
|
||||
}
|
||||
}
|
||||
"$ref": "#/components/schemas/Pet"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,8 @@ describe('CONVERT FUNCTION TESTS ', function() {
|
||||
responseBody = conversionResult.output[0].data.item[0].item[0].response[0].body;
|
||||
expect(err).to.be.null;
|
||||
expect(requestBody).to.equal('{\n "name": "<string>",\n "tag": "<string>"\n}');
|
||||
expect(responseBody).to.equal('[\n {\n "id": "<long>"\n },\n {\n "id": "<long>"\n }\n]');
|
||||
expect(responseBody).to.equal('[\n {\n "id": "<long>",\n "name": "<string>"\n }' +
|
||||
',\n {\n "id": "<long>",\n "name": "<string>"\n }\n]');
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user