tim-vandecasteele/grape-swagger

View on GitHub
lib/grape-swagger/doc_methods/produces_consumes.rb

Summary

Maintainability
A
0 mins
Test Coverage
module GrapeSwagger
  module DocMethods
    class ProducesConsumes
      class << self
        def call(*args)
          return ['application/json'] unless args.flatten.present?
          args.flatten.map { |x| Grape::ContentTypes::CONTENT_TYPES[x] || x }.uniq
        end
      end
    end
  end
end