lib/schema/transform.js
function transform(value, options) {
  options = options || {};

  return traverse(value, {
    beforeObject: function(v) {
      if (options.removeFormats &&
          typeof v.format === 'string' &&
          typeof v.type === 'string' &&
          v.type !== 'string') {
        delete v.format;
      }

      return v;
    },
    afterObject: function(v) {
      if (options.convertRefs &&
          typeof v.type === 'string' &&
          constants.notModel.indexOf(v.type) < 0) {
        return { $ref: v.type };
      }

      return v;
    },
  });
}
function transform(value, options) {
  options = options || {};

  return traverse(value, {
    beforeObject: function(v) {
      if (options.removeFormats &&
          typeof v.format === 'string' &&
          typeof v.type === 'string' &&
          v.type !== 'string') {
        delete v.format;
      }

      return v;
    },
    afterObject: function(v) {
      if (options.convertRefs &&
          typeof v.type === 'string' &&
          constants.notModel.indexOf(v.type) < 0) {
        return { $ref: v.type };
      }

      return v;
    },
  });
}
function transform ( value , options ) { options = options || { } ; return traverse ( value , { beforeObject : function ( v ) { if ( options . removeFormats && typeof v . format === 'string' && typeof v . type === 'string' && v . type !== 'string' ) { delete v . format ; } return v ; } , afterObject : function ( v ) { if ( options . convertRefs && typeof v . type === 'string' && constants . notModel . indexOf ( v . type ) < 0 ) { return { $ref : v . type } ; } return v ; } , } ) ; }
Transform Swagger spec.
Transform Swagger spec .