Skip to content

Commit a073e90

Browse files
committed
Fixed options.md related test to include module version as well
1 parent 3708aef commit a073e90

File tree

2 files changed

+34
-33
lines changed

2 files changed

+34
-33
lines changed

OPTIONS.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
id|type|available options|default|description|usage
2-
|---|---|---|---|---|---|
3-
requestNameSource|enum|URL, Fallback|Fallback|Determines how the requests inside the generated collection will be named. If “Fallback” is selected, the request will be named after one of the following schema values: `summary`, `operationId`, `description`, `url`.|CONVERSION, VALIDATION
4-
indentCharacter|enum|Space, Tab|Space|Option for setting indentation character.|CONVERSION
5-
collapseFolders|boolean|-|true|Importing will collapse all folders that have only one child element and lack persistent folder-level data.|CONVERSION
6-
optimizeConversion|boolean|-|true|Optimizes conversion for large specification, disabling this option might affect the performance of conversion.|CONVERSION
7-
requestParametersResolution|enum|Example, Schema|Schema|Select whether to generate the request parameters based on the [schema](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) or the [example](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) in the schema.|CONVERSION
8-
exampleParametersResolution|enum|Example, Schema|Example|Select whether to generate the response parameters based on the [schema](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) or the [example](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) in the schema.|CONVERSION
9-
disabledParametersValidation|boolean|-|true|Whether disabled parameters of collection should be validated|VALIDATION
10-
parametersResolution|enum|Example, Schema|Schema|Select whether to generate the request and response parameters based on the [schema](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) or the [example](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) in the schema.|CONVERSION
11-
folderStrategy|enum|Paths, Tags|Paths|Select whether to create folders according to the spec’s paths or tags.|CONVERSION
12-
schemaFaker|boolean|-|true|Whether or not schemas should be faked.|CONVERSION
13-
stackLimit|integer|-|10|Number of nesting limit till which schema resolution will happen. Increasing this limit may result in more time to convert collection depending on complexity of specification. (To make sure this option works correctly "optimizeConversion" option needs to be disabled)|CONVERSION
14-
includeAuthInfoInExample|boolean|-|true|Select whether to include authentication parameters in the example request.|CONVERSION
15-
shortValidationErrors|boolean|-|false|Whether detailed error messages are required for request <> schema validation operations.|VALIDATION
16-
validationPropertiesToIgnore|array|-|[]|Specific properties (parts of a request/response pair) to ignore during validation. Must be sent as an array of strings. Valid inputs in the array: PATHVARIABLE, QUERYPARAM, HEADER, BODY, RESPONSE_HEADER, RESPONSE_BODY|VALIDATION
17-
showMissingInSchemaErrors|boolean|-|false|MISSING_IN_SCHEMA indicates that an extra parameter was included in the request. For most use cases, this need not be considered an error.|VALIDATION
18-
detailedBlobValidation|boolean|-|false|Determines whether to show detailed mismatch information for application/json content in the request/response body.|VALIDATION
19-
suggestAvailableFixes|boolean|-|false|Whether to provide fixes for patching corresponding mismatches.|VALIDATION
20-
validateMetadata|boolean|-|false|Whether to show mismatches for incorrect name and description of request|VALIDATION
21-
ignoreUnresolvedVariables|boolean|-|false|Whether to ignore mismatches resulting from unresolved variables in the Postman request|VALIDATION
22-
strictRequestMatching|boolean|-|false|Whether requests should be strictly matched with schema operations. Setting to true will not include any matches where the URL path segments don't match exactly.|VALIDATION
23-
allowUrlPathVarMatching|boolean|-|false|Whether to allow matching path variables that are available as part of URL itself in the collection request|VALIDATION
24-
enableOptionalParameters|boolean|-|true|Optional parameters aren't selected in the collection. Once enabled they will be selected in the collection and request as well.|CONVERSION
25-
keepImplicitHeaders|boolean|-|false|Whether to keep implicit headers from the OpenAPI specification, which are removed by default.|CONVERSION
26-
includeWebhooks|boolean|-|false|Select whether to include Webhooks in the generated collection|CONVERSION
27-
includeReferenceMap|boolean|-|false|Whether or not to include reference map or not as part of output|BUNDLE
28-
includeDeprecated|boolean|-|true|Select whether to include deprecated operations, parameters, and properties in generated collection or not|CONVERSION, VALIDATION
1+
id|type|available options|default|description|usage|version
2+
|---|---|---|---|---|---|---|
3+
requestNameSource|enum|URL, Fallback|Fallback|Determines how the requests inside the generated collection will be named. If “Fallback” is selected, the request will be named after one of the following schema values: `summary`, `operationId`, `description`, `url`.|CONVERSION, VALIDATION|v2, v1
4+
indentCharacter|enum|Space, Tab|Space|Option for setting indentation character.|CONVERSION|v2, v1
5+
collapseFolders|boolean|-|true|Importing will collapse all folders that have only one child element and lack persistent folder-level data.|CONVERSION|v1
6+
optimizeConversion|boolean|-|true|Optimizes conversion for large specification, disabling this option might affect the performance of conversion.|CONVERSION|v1
7+
requestParametersResolution|enum|Example, Schema|Schema|Select whether to generate the request parameters based on the [schema](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) or the [example](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) in the schema.|CONVERSION|v1
8+
exampleParametersResolution|enum|Example, Schema|Example|Select whether to generate the response parameters based on the [schema](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) or the [example](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) in the schema.|CONVERSION|v1
9+
parametersResolution|enum|Example, Schema|Schema|Select whether to generate the request and response parameters based on the [schema](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) or the [example](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) in the schema.|CONVERSION|v2, v1
10+
folderStrategy|enum|Paths, Tags|Paths|Select whether to create folders according to the spec’s paths or tags.|CONVERSION|v2, v1
11+
includeAuthInfoInExample|boolean|-|true|Select whether to include authentication parameters in the example request.|CONVERSION|v2, v1
12+
shortValidationErrors|boolean|-|false|Whether detailed error messages are required for request <> schema validation operations.|VALIDATION|v2, v1
13+
validationPropertiesToIgnore|array|-|[]|Specific properties (parts of a request/response pair) to ignore during validation. Must be sent as an array of strings. Valid inputs in the array: PATHVARIABLE, QUERYPARAM, HEADER, BODY, RESPONSE_HEADER, RESPONSE_BODY|VALIDATION|v2, v1
14+
showMissingInSchemaErrors|boolean|-|false|MISSING_IN_SCHEMA indicates that an extra parameter was included in the request. For most use cases, this need not be considered an error.|VALIDATION|v2, v1
15+
detailedBlobValidation|boolean|-|false|Determines whether to show detailed mismatch information for application/json content in the request/response body.|VALIDATION|v2, v1
16+
suggestAvailableFixes|boolean|-|false|Whether to provide fixes for patching corresponding mismatches.|VALIDATION|v2, v1
17+
validateMetadata|boolean|-|false|Whether to show mismatches for incorrect name and description of request|VALIDATION|v2, v1
18+
ignoreUnresolvedVariables|boolean|-|false|Whether to ignore mismatches resulting from unresolved variables in the Postman request|VALIDATION|v2, v1
19+
strictRequestMatching|boolean|-|false|Whether requests should be strictly matched with schema operations. Setting to true will not include any matches where the URL path segments don't match exactly.|VALIDATION|v2, v1
20+
allowUrlPathVarMatching|boolean|-|false|Whether to allow matching path variables that are available as part of URL itself in the collection request|VALIDATION|v2, v1
21+
enableOptionalParameters|boolean|-|true|Optional parameters aren't selected in the collection. Once enabled they will be selected in the collection and request as well.|CONVERSION|v1
22+
keepImplicitHeaders|boolean|-|false|Whether to keep implicit headers from the OpenAPI specification, which are removed by default.|CONVERSION|v2, v1
23+
includeDeprecated|boolean|-|true|Select whether to include deprecated operations, parameters, and properties in generated collection or not|CONVERSION, VALIDATION|v2, v1

test/system/structure.test.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ const optionIds = [
232232
* @returns {String} - markdown table consisting documetation for options
233233
*/
234234
function generateOptionsDoc (options) {
235-
var doc = 'id|type|available options|default|description|usage\n|---|---|---|---|---|---|\n';
235+
var doc = 'id|type|available options|default|description|usage|version\n|---|---|---|---|---|---|---|\n';
236236

237237
_.forEach(options, (option) => {
238238
var convertArrayToDoc = (array) => {
@@ -246,7 +246,8 @@ function generateOptionsDoc (options) {
246246
(_.isEmpty(defaultOption)) && (defaultOption = JSON.stringify(defaultOption));
247247

248248
doc += `${option.id}|${option.type}|${convertArrayToDoc(option.availableOptions, true)}|` +
249-
`${defaultOption}|${option.description}|${convertArrayToDoc(option.usage)}\n`;
249+
`${defaultOption}|${option.description}|${convertArrayToDoc(option.usage)}|` +
250+
`${convertArrayToDoc(option.supportedModuleVersion)}\n`;
250251
});
251252
return doc;
252253
}
@@ -300,8 +301,13 @@ describe('getOptions', function() {
300301

301302
describe('OPTIONS.md', function() {
302303
it('must contain all details of options', function () {
303-
const optionsDoc = fs.readFileSync('OPTIONS.md', 'utf-8');
304-
expect(optionsDoc).to.eql(generateOptionsDoc(getOptions(undefined,
305-
{ usage: ['CONVERSION', 'VALIDATION', 'BUNDLE'] })));
304+
const optionsDoc = fs.readFileSync('OPTIONS.md', 'utf-8'),
305+
v1Options = getOptions(undefined,
306+
{ usage: ['CONVERSION', 'VALIDATION', 'BUNDLE'], moduleVersion: 'v1' }),
307+
v2Options = getOptions(undefined,
308+
{ usage: ['CONVERSION', 'VALIDATION', 'BUNDLE'], moduleVersion: 'v2' }),
309+
allOptions = _.uniqBy(_.concat(v1Options, v2Options), 'id');
310+
311+
expect(optionsDoc).to.eql(generateOptionsDoc(allOptions));
306312
});
307313
});

0 commit comments

Comments
 (0)