Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/grape-swagger/doc_methods/produces_consumes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class << self
def call(*args)
return ['application/json'] unless args.flatten.present?

args.flatten.map { |x| Grape::ContentTypes::CONTENT_TYPES[x] || x }.uniq
args.flatten.map { |x| Grape::ContentTypes::DEFAULTS[x] || x }.uniq
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/grape-swagger/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def content_types_for(target_class)
if content_types.empty?
formats = [target_class.format, target_class.default_format].compact.uniq
formats = Grape::Formatter.formatters(**{}).keys if formats.empty?
content_types = Grape::ContentTypes::CONTENT_TYPES.select do |content_type, _mime_type|
content_types = Grape::ContentTypes::DEFAULTS.select do |content_type, _mime_type|
formats.include? content_type
end.values
end
Expand Down