message: added tests to verify examples in x-ms-examples are correct syntactically and match the schema
diff: @@ -21,11 +21,12 @@ var exampleSchemaUrl = "https://raw.githubusercontent.com/Azure/autorest/master/
  var compositeSchemaUrl = "https://raw.githubusercontent.com/Azure/autorest/master/schema/composite-swagger.json";
  var swaggerSchema, extensionSwaggerSchema, schema4, exampleSchema, compositeSchema,
  - globPath, compositeGlobPath, swaggers, compositeSwaggers, validator;
  + globPath, compositeGlobPath, exampleGlobPath, swaggers, compositeSwaggers, examples, validator;
  globPath = path.join(__dirname, '../', '/**/swagger/*.json');
  swaggers = _(glob.sync(globPath));
  +
  // Useful when debugging a test for a particular swagger.
  // Just update the regex. That will return an array of filtered items.
  // swaggers = swaggers.filter(function(item) {
  @@ -35,6 +36,9 @@ swaggers = _(glob.sync(globPath));
  compositeGlobPath = path.join(__dirname, '../', '/**/composite*.json');
  compositeSwaggers = _(glob.sync(compositeGlobPath));
  +exampleGlobPath = path.join(__dirname, '../', '/**/examples/*.json');
  +examples = _(glob.sync(exampleGlobPath));
  +
  // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
  // because the buffer-to-string conversion in `fs.readFile()`
  // translates it to FEFF, the UTF-16 BOM.
  @@ -155,6 +159,29 @@ describe('Azure Swagger Schema Validation', function () {
  });
  });
  }).value();
  +
  + _(examples).each(function (example) {
  + it('x-ms-examples: ' + example + ' should be a valid x-ms-example.', function (done) {
  + fs.readFile(example, 'utf8', function (err, data) {
  + if (err) { done(err); }
  + var parsedData;
  + try {
  + parsedData = JSON.parse(stripBOM(data));
  + } catch (err) {
  + throw new Error("example file " + example + " is an invalid JSON. " + util.inspect(err, { depth: null }));
  + }
  +
  + var valid = validator.validate(parsedData, exampleSchema);
  + if (!valid) {
  + var error = validator.getLastErrors();
  + throw new Error("Schema validation failed: " + util.inspect(error, { depth: null }));
  + }
  + assert(valid === true);
  + done();
  + });
  + });
  + }).value();
  +
  });
  describe('External file or url references ("$ref") in a swagger spec', function () {
  