if tag.present? && tag.is_a?(Hash)
  json.name tag['name']
  json.id tag['id']
  json.zipball_url render_zip_url(@owner, @repository, tag['name'])
  json.tarball_url render_tar_url(@owner, @repository, tag['name'])
  json.tagger do 
    if tag['tagger'].present?
      json.partial! 'api/v1/users/commit_user', user: render_cache_commit_author(tag['tagger']), name: tag['tagger']['name']
    else
      json.nil!
    end
  end
  json.time_ago time_from_now(tag['tagger']['date'].to_time)
  json.created_at_unix tag['tagger']['date'].to_time.to_i
  json.created_time tag['tagger']['date'].to_time
  json.message tag['message']
  json.commit do
    json.sha tag['commit']['sha']
    json.message tag['commit']['message']
    json.time_ago time_from_now(tag['commit']['committer']['date'].to_time)
    json.created_at_unix tag['commit']['committer']['date'].to_time.to_i
    json.committer do 
      json.partial! 'api/v1/users/commit_user', user: render_cache_commit_author(tag['commit']['committer']), name: tag['commit']['committer']['name']
    end
    json.author do 
      json.partial! 'api/v1/users/commit_user', user: render_cache_commit_author(tag['commit']['author']), name: tag['commit']['author']['name']
    end
  end
else 
  json.name tag
end