Skip to content

Commit 35ece65

Browse files
committed
Added option to set preferred request body content-type
1 parent 516c342 commit 35ece65

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

OPTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ enableOptionalParameters|boolean|-|true|Optional parameters aren't selected in t
2222
keepImplicitHeaders|boolean|-|false|Whether to keep implicit headers from the OpenAPI specification, which are removed by default.|CONVERSION|v2, v1
2323
includeDeprecated|boolean|-|true|Select whether to include deprecated operations, parameters, and properties in generated collection or not|CONVERSION, VALIDATION|v2, v1
2424
alwaysInheritAuthentication|boolean|-|false|Whether authentication details should be included on every request, or always inherited from the collection.|CONVERSION|v2, v1
25-
preferredRequestBodyType|enum|x-www-form-urlencoded, form-data, raw|x-www-form-urlencoded|When there are multiple content-types defined in the request body of OpenAPI, select the preferred option content-type as request body.|CONVERSION|v2, v1
25+
preferredRequestBodyType|enum|x-www-form-urlencoded, form-data, raw, first-listed|x-www-form-urlencoded|When there are multiple content-types defined in the request body of OpenAPI, select the preferred option content-type as request body.If "first-in-spec" is selected, the first content-type defined in the OpenAPI spec will be selected.|CONVERSION|v2, v1

lib/options.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,11 @@ module.exports = {
392392
id: 'preferredRequestBodyType',
393393
type: 'enum',
394394
default: 'x-www-form-urlencoded',
395-
availableOptions: ['x-www-form-urlencoded', 'form-data', 'raw'],
396-
description: 'When there are multiple content-types defined in the request body of OpenAPI, select the ' +
397-
'preferred option content-type as request body.',
398-
external: true,
395+
availableOptions: ['x-www-form-urlencoded', 'form-data', 'raw', 'first-listed'],
396+
description: 'When there are multiple content-types defined in the request body of OpenAPI, the conversion ' +
397+
'selects the preferred option content-type as request body.If "first-listed" is set, the first ' +
398+
'content-type defined in the OpenAPI spec will be selected.',
399+
external: false,
399400
usage: ['CONVERSION'],
400401
supportedIn: [VERSION20, VERSION30, VERSION31],
401402
supportedModuleVersion: [MODULE_VERSION.V2, MODULE_VERSION.V1]

test/system/structure.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,10 @@ const optionIds = [
237237
name: 'Select request body type',
238238
type: 'enum',
239239
default: 'x-www-form-urlencoded',
240-
availableOptions: ['x-www-form-urlencoded', 'form-data', 'raw'],
241-
description: 'When there are multiple content-types defined in the request body of OpenAPI, select the ' +
242-
'preferred option content-type as request body.',
240+
availableOptions: ['x-www-form-urlencoded', 'form-data', 'raw', 'first-listed'],
241+
description: 'When there are multiple content-types defined in the request body of OpenAPI, the conversion ' +
242+
'selects the preferred option content-type as request body.If "first-listed" is set, the first ' +
243+
'content-type defined in the OpenAPI spec will be selected.',
243244
external: true,
244245
usage: ['CONVERSION']
245246
}

0 commit comments

Comments
 (0)