def compile(action = nil, **args)
if block.parameters.any? { |(type, name)| name == :media_type && type == :keyreq } && action && !(args.key? :media_type)
media_type = action.endpoint_definition.media_type
unless media_type
raise Exceptions::InvalidConfiguration, "Could not default :media_type argument for response template #{@name}." \
" Endpoint #{action.endpoint_definition} does not have an associated mediatype and none was passed"
end
args[:media_type] = media_type
end
Praxis::ResponseDefinition.new(name, **args, &block)
end