Skip to content
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

Merged
merged 13 commits into from Nov 15, 2019

Conversation

Dhroov7
Copy link
Contributor

@Dhroov7 Dhroov7 commented Oct 14, 2019

No description provided.

…n root request and examples request and response
index.js Outdated
return [
{
name: 'Fake schema',
id: 'schemaFaker',
Copy link
Member

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.

Copy link
Member

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),
Copy link
Member

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

@Dhroov7 Dhroov7 changed the title added two options for choosing body type between schema and example added two more options for choosing body type between schema and example Oct 21, 2019
lib/convert.js Outdated
definedOptions[0].default),
schemaFaker: (options.hasOwnProperty('schemaFaker') ? options.schemaFaker :
definedOptions[1].default),
indentCharacter: (options.hasOwnProperty('indentCharacter') ? options.indentCharacter :
Copy link
Member

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'
Copy link
Member

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',
Copy link
Member

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?

@abhijitkane abhijitkane merged commit f34a25a into develop Nov 15, 2019
@umeshp7 umeshp7 deleted the feature/add_options branch January 22, 2020 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants