src/js2dt.js
function convertFileType (data) {
  data['type'] = 'file'
  const anyOf = data.media.anyOf
  if (anyOf && anyOf.length > 0) {
    data['fileTypes'] = []
    anyOf.forEach(function (el) {
      if (el.mediaType) {
        data.fileTypes.push(el.mediaType)
      }
    })
    if (data.fileTypes.length < 1) {
      delete data.fileTypes
    }
  }
  delete data.media
  return data
}
function convertFileType (data) {
  data['type'] = 'file'
  const anyOf = data.media.anyOf
  if (anyOf && anyOf.length > 0) {
    data['fileTypes'] = []
    anyOf.forEach(function (el) {
      if (el.mediaType) {
        data.fileTypes.push(el.mediaType)
      }
    })
    if (data.fileTypes.length < 1) {
      delete data.fileTypes
    }
  }
  delete data.media
  return data
}
function convertFileType ( data ) { data [ 'type' ] = 'file' const anyOf = data . media . anyOf if ( anyOf && anyOf . length > 0 ) { data [ 'fileTypes' ] = [ ] anyOf . forEach ( function ( el ) { if ( el . mediaType ) { data . fileTypes . push ( el . mediaType ) } } ) if ( data . fileTypes . length < 1 ) { delete data . fileTypes } } delete data . media return data }
Change JSON type to RAML file type.

@param  {Object} data
@returns  {Object}
Change JSON type to RAML file type .