Skip to content

Commit 33c7218

Browse files
author
Vishal Shingala
committed
Added default field in OPTIONS.md
1 parent c08048d commit 33c7218

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

OPTIONS.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
id|type|available options|description|usage
2-
|---|---|---|---|---|
3-
requestNameSource|enum|**Fallback**, URL|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: `description`, `operationid`, `url`.|CONVERSION, VALIDATION
4-
indentCharacter|enum|**Space**, Tab|Option for setting indentation character|CONVERSION
5-
collapseFolders|boolean|-|Importing will collapse all folders that have only one child element and lack persistent folder-level data.|CONVERSION
6-
optimizeConversion|boolean|-|Optimizes conversion for large specification, disabling this option might affect the performance of conversion.|CONVERSION
7-
requestParametersResolution|enum|**Schema**, Example|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|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-
folderStrategy|enum|**Paths**, Tags|Select whether to create folders according to the spec’s paths or tags.|CONVERSION
10-
includeAuthInfoInExample|boolean|-|Select whether to include authentication parameters in the example request|CONVERSION
11-
shortValidationErrors|boolean|-|Whether detailed error messages are required for request <> schema validation operations.|VALIDATION
12-
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
13-
showMissingInSchemaErrors|boolean|-|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
14-
detailedBlobValidation|boolean|-|Determines whether to show detailed mismatch information for application/json content in the request/response body.|VALIDATION
15-
suggestAvailableFixes|boolean|-|Whether to provide fixes for patching corresponding mismatches.|VALIDATION
16-
validateMetadata|boolean|-|Whether to show mismatches for incorrect name and description of request|VALIDATION
17-
ignoreUnresolvedVariables|boolean|-|Whether to ignore mismatches resulting from unresolved variables in the Postman request|VALIDATION
18-
strictRequestMatching|boolean|-|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
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: `description`, `operationid`, `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+
folderStrategy|enum|Paths, Tags|Paths|Select whether to create folders according to the spec’s paths or tags.|CONVERSION
10+
includeAuthInfoInExample|boolean|-|true|Select whether to include authentication parameters in the example request|CONVERSION
11+
shortValidationErrors|boolean|-|false|Whether detailed error messages are required for request <> schema validation operations.|VALIDATION
12+
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
13+
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
14+
detailedBlobValidation|boolean|-|false|Determines whether to show detailed mismatch information for application/json content in the request/response body.|VALIDATION
15+
suggestAvailableFixes|boolean|-|false|Whether to provide fixes for patching corresponding mismatches.|VALIDATION
16+
validateMetadata|boolean|-|false|Whether to show mismatches for incorrect name and description of request|VALIDATION
17+
ignoreUnresolvedVariables|boolean|-|false|Whether to ignore mismatches resulting from unresolved variables in the Postman request|VALIDATION
18+
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

test/system/structure.test.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,21 @@ const optionIds = [
149149
* @returns {String} - markdown table consisting documetation for options
150150
*/
151151
function generateOptionsDoc (options) {
152-
var doc = 'id|type|available options|description|usage\n|---|---|---|---|---|\n';
152+
var doc = 'id|type|available options|default|description|usage\n|---|---|---|---|---|---|\n';
153153

154154
_.forEach(options, (option) => {
155-
var convertArrayToDoc = (array, useFirstElementDefault = false) => {
156-
return _.reduce(array, (acc, ele, key) => {
157-
return (_.isEmpty(acc) ? acc : acc + ', ') + (useFirstElementDefault && !key ? `**${ele}**` : ele);
155+
var convertArrayToDoc = (array) => {
156+
return _.reduce(array, (acc, ele) => {
157+
return (_.isEmpty(acc) ? acc : acc + ', ') + ele;
158158
}, '') || '-';
159159
},
160-
availableOptions = option.type === 'enum' ? _.uniq(_.concat([option.default], option.availableOptions)) : [];
160+
defaultOption = option.default;
161161

162-
doc += `${option.id}|${option.type}|${convertArrayToDoc(availableOptions, true)}|` +
163-
`${option.description}|${convertArrayToDoc(option.usage)}\n`;
162+
// override empty values with stringified equivalent to represent correctly in README
163+
(_.isEmpty(defaultOption)) && (defaultOption = JSON.stringify(defaultOption));
164+
165+
doc += `${option.id}|${option.type}|${convertArrayToDoc(option.availableOptions, true)}|` +
166+
`${defaultOption}|${option.description}|${convertArrayToDoc(option.usage)}\n`;
164167
});
165168
return doc;
166169
}

0 commit comments

Comments
 (0)