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
added two more options for choosing body type between schema and example #122
Conversation
…n root request and examples request and response
index.js
Outdated
return [ | ||
{ | ||
name: 'Fake schema', | ||
id: 'schemaFaker', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used only for schema faking? using examples/defaults instead of schemas isn't technically faking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, all the names should feel the same
some sound like instructions to the user - Set root request body type
, some sound like instructions to the converter - Collapse folder...
lib/convert.js
Outdated
@@ -60,7 +60,9 @@ var sdk = require('postman-collection'), | |||
requestNameSource: (options.hasOwnProperty('requestNameSource') ? options.requestNameSource : 'fallback'), | |||
schemaFaker: (options.hasOwnProperty('schemaFaker') ? options.schemaFaker : true), | |||
indentCharacter: (options.hasOwnProperty('indentCharacter') ? options.indentCharacter : ' '), | |||
collapseLongFolders: (options.hasOwnProperty('collapseLongFolders') ? options.collapseLongFolders : true) | |||
collapseLongFolders: (options.hasOwnProperty('collapseLongFolders') ? options.collapseLongFolders : true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dhroov7 The defaults are hard-coded here again. This should come directly from the getOptions function
lib/convert.js
Outdated
definedOptions[0].default), | ||
schemaFaker: (options.hasOwnProperty('schemaFaker') ? options.schemaFaker : | ||
definedOptions[1].default), | ||
indentCharacter: (options.hasOwnProperty('indentCharacter') ? options.indentCharacter : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indices cannot be hard-coded. Need to convert to a map and use lodash.merge to assign defaults
lib/convert.js
Outdated
id: 'schemaFaker', | ||
type: 'boolean', | ||
default: true, | ||
description: 'Option for Fake the schema using json or xml schema faker' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option for faking
Why the uppercase?
json and xml need to be uppercase, not lowercase
}, | ||
{ | ||
name: 'Set example request and response body type', | ||
id: 'exampleParametersResolution', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this option used in code?
…nd switch case to set default values of the missing options
No description provided.