Skip to content

Commit

Permalink
Some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoberger committed Mar 22, 2017
1 parent 8a6d0fc commit cc60181
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,30 @@ exports.findSwagger = function(info, cb) {
swaggerInline('**/*', {
format: '.json',
metadata: true,
}).then((generatedSwagger) => {
generatedSwagger = JSON.parse(generatedSwagger);
}).then((generatedSwaggerString) => {
var generatedSwagger = JSON.parse(generatedSwaggerString);

if(!generatedSwagger['x-si-base']) {
console.log("We couldn't find a Swagger file.".red);
console.log("Don't worry, it's easy to get started! Run " + "oas init".yellow + " to get started.");
process.exit();
}

var generatedSwaggerClone = _.clone(generatedSwaggerClone); // Becasue swagger.validate modifies the original JSON
var generatedSwaggerClone = JSON.parse(generatedSwaggerString); // Becasue swagger.validate modifies the original JSON
swagger.validate(generatedSwaggerClone, function(err, api) {
if(err) {

// TODO: We should go through the crappy validation stuff
// and try to make it easier to understand

if (info.v) {
if (info.opts.v) {
console.log(cardinal.highlight(JSON.stringify(generatedSwagger, undefined, 2)));
}

console.log("");
console.log("Error validating Swagger!".red);
console.log("");
if (!info.v) {
if (!info.opts.v) {
console.log("Run with " + "-v".grey + " to see the invalid Swagger");
console.log("");
}
Expand Down

0 comments on commit cc60181

Please sign in to comment.