Skip to content

Commit 930197a

Browse files
authored
Merge pull request #804 from postmanlabs/feature/fix-default-module-version
Fixed issue with getOptions() API where default module version was still v1.
2 parents 1c2c120 + 822b770 commit 930197a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/options.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ module.exports = {
4747
*
4848
* @param {string} [mode='document'] Describes use-case. 'document' will return an array
4949
* with all options being described. 'use' will return the default values of all options
50-
* @param {Object} criteria Decribes required criteria for options to be returned. can have properties
51-
* external: <boolean>
52-
* usage: <array> (Array of supported usage type - CONVERSION, VALIDATION)
53-
* version: <string> ('3.0' by default, supported values: '3.0', '3.1')
50+
* @param {Object} criteria Decribes required criteria for options to be returned.
51+
* @param {string} criteria.version The version of the OpenAPI spec to be converted
52+
* (can be one of '2.0', '3.0', '3.1')
53+
* @param {string} criteria.moduleVersion The version of the module (can be one of 'v1' or 'v2')
54+
* @param {Array<string>} criteria.usage The usage of the option (values can be one of 'CONVERSION', 'VALIDATION')
55+
* @param {boolean} criteria.external Whether the option is exposed to Postman App UI or not
5456
* @returns {mixed} An array or object (depending on mode) that describes available options
5557
*/
5658
getOptions: function(mode = 'document', criteria = {}) {
@@ -408,7 +410,7 @@ module.exports = {
408410
}
409411

410412
// Setting default value
411-
criteria.moduleVersion = _.has(criteria, 'moduleVersion') ? criteria.moduleVersion : MODULE_VERSION.V1;
413+
criteria.moduleVersion = _.has(criteria, 'moduleVersion') ? criteria.moduleVersion : MODULE_VERSION.V2;
412414

413415
if (!_.includes(option.supportedModuleVersion, criteria.moduleVersion)) {
414416
return false;

0 commit comments

Comments
 (0)