Skip to content

fix: requestNameSource with operationId #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPTIONS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id|type|available options|default|description|usage
|---|---|---|---|---|---|
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
requestNameSource|enum|URL, Fallback, operationId|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`, `url`.|CONVERSION, VALIDATION
indentCharacter|enum|Space, Tab|Space|Option for setting indentation character|CONVERSION
collapseFolders|boolean|-|true|Importing will collapse all folders that have only one child element and lack persistent folder-level data.|CONVERSION
optimizeConversion|boolean|-|true|Optimizes conversion for large specification, disabling this option might affect the performance of conversion.|CONVERSION
Expand Down
2 changes: 1 addition & 1 deletion lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = {
id: 'requestNameSource',
type: 'enum',
default: 'Fallback',
availableOptions: ['URL', 'Fallback'],
availableOptions: ['URL', 'Fallback','operationId'],
description: '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`.',
Expand Down
4 changes: 4 additions & 0 deletions lib/schemaUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,10 @@ module.exports = {
}
break;
}
case 'operationid':{
reqName = operation.operationId
break;
}
case 'url' : {
reqName = displayUrl || baseUrl;
break;
Expand Down