fixExamplesByVersion(schema) {
    // This method could be removed when schema faker gets upgraded
    const hasExamplesInRoot = _.has(schema, 'examples'),
      hasChildItems = _.has(schema, 'type') &&
      _.has(schema, 'items'),
      hasProperties = _.has(schema, 'properties'),
      typeIsAnArray = _.has(schema, 'type') &&
        Array.isArray(schema.type);

    if (hasExamplesInRoot && typeIsAnArray) {
      let typeAndExample = this.findTypeByExample(schema.examples, schema.type),
        foundType = typeAndExample.foundType,
        foundExample = typeAndExample.foundExample;
      schema.type = foundType ? foundType : schema.type[0];
      schema.example = foundExample ? foundExample : schema.examples[0];
    }

    if (hasExamplesInRoot && !typeIsAnArray) {
      schema.example = schema.examples[0];
    }

    if (!hasExamplesInRoot && typeIsAnArray) {
      schema.type = schema.type[0];
    }

    if (!hasExamplesInRoot && hasChildItems) {
      schema.items = this.fixExamplesByVersion(schema.items);
    }
    else if (hasProperties) {
      const schemaProperties = _.keys(schema.properties);
      schemaProperties.forEach((property) => {
        schema.properties[property] = this.fixExamplesByVersion(schema.properties[property]);
      });
    }
    return schema;
  }
Takes the first element from 'examples' property in a schema and adds a new 'example' property.
This method is used before faking the schema. (Schema faker uses the example property to fakle the schema)
@param {object} schema a provided schema
@returns {object} it returns the schema with a new example property