def optional(*attrs, &block)
orig_attrs = attrs.clone
opts = attrs.extract_options!.clone
type = opts[:type]
opts = @group.merge(opts) if @group
if attrs && block_given?
raise Grape::Exceptions::MissingGroupTypeError.new if type.nil?
raise Grape::Exceptions::UnsupportedGroupTypeError.new unless Grape::Validations::Types.group?(type)
end
if opts[:using]
require_optional_fields(attrs.first, opts)
else
validate_attributes(attrs, opts, &block)
block_given? ? new_scope(orig_attrs, true, &block) : push_declared_params(attrs, opts.slice(:as))
end
end