-
Couldn't load subscription status.
- Fork 42
Add readme tag support #115
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
Conversation
| if (Info != null && | ||
| previousDefinition.Info != null && | ||
| Info.Version != null && | ||
| previousDefinition.Info.Version != null) |
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.
you can use sequential check to simpify :
Info?.Version != null && previousDefinition.Info?.Version != null #Closed
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.
Done #Closed
lib/commands/oad.js
Outdated
| default: true | ||
| }, | ||
| o: { | ||
| alias: 'old-tag-name', |
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.
old-tag-name [](start = 12, length = 12)
oad uses camelCase parameters
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.
Done
| n: { | ||
| alias: 'new-tag-name', | ||
| describe: 'The tag name for the readme. If include also indicates that the old spec file is a readme file', | ||
| } |
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 we need to update the readme for the new option and the changelog
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.
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.
Done
| * @param {string} swaggerPath Path to the specification file. | ||
| * | ||
| * @param {string} outputFileName Name of the output file to which autorest outputs swagger-doc. | ||
| * |
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.
missing comment for new param
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.
Done #Closed
lib/validators/openApiDiff.js
Outdated
| let autoRestCmd = `${self.autoRestPath()} --input-file=${swaggerPath} --output-artifact=swagger-document.json --output-file=${outputFileName} --output-folder=${outputFolder}`; | ||
| var autoRestCmd; | ||
| if(tagName) { | ||
| autoRestCmd = `${self.autoRestPath()} ${swaggerPath} --tag=${tagName} --output-artifact=swagger-document.json --output-file=${outputFileName} --output-folder=${outputFolder}`; |
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.
nit: ternary operator instead tslint
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.
Done
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.
🕐
cli.js
Outdated
| alias: 'newTagName', | ||
| describe: `The tag name for the new specification file. If include it ` + | ||
| `indicates that the new spec file is a readme file` | ||
| }) |
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.
here should be only global parameters ( i.e. not tied to a command), those should go in the specific command folder. You can check https://github.com/yargs/yargs/blob/master/docs/advanced.md for documentation on how to structure yargs.
lib/validators/openApiDiff.js
Outdated
| var promise1 = self.processViaAutoRest(oldSwagger, 'old'); | ||
| var promise2 = self.processViaAutoRest(newSwagger, 'new'); | ||
| var promise1 = self.processViaAutoRest(oldSwagger, 'old', self.options.oldTagName); | ||
| var promise2 = self.processViaAutoRest(newSwagger, 'new', self.options.newTagName); |
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.
self.options.newTagName); [](start = 62, length = 25)
it doesn't really make sense to have the tag name in the constructor right ? that would mean if we call compare multiple times there will be static tags. Maybe add them as optional parameters to compare
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.
This makes sense, we send in two swaggers and a tag is associated with a swagger. This seems like an ok implementation.
lib/commands/oad.js
Outdated
|
|
||
| let compareFunc; | ||
| if(oldTag && newTag) { | ||
| compareFunc = validate.compareTags(oldSpec, oldTag, oldSpec, newTag, vOptions); |
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.
typo newSpec
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.
Fixed
| log.filepath = options.logFilepath || log.filepath; | ||
| let openApiDiff = new OpenApiDiff(options); | ||
|
|
||
| return openApiDiff.compare(oldSwagger, newSwagger, oldTag, newTag); |
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.
since this will always be a Readme, maybe we can name it something like oldReadme newReadme
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.
Lets look at this in a subsequent checkin.
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.
LGTM
No description provided.