lib/easy/jsonapi/exceptions/user_defined_exceptions.rb in easy-jsonapi-1.0.4 vs lib/easy/jsonapi/exceptions/user_defined_exceptions.rb in easy-jsonapi-1.0.5
- old
+ new
@@ -60,12 +60,14 @@
# to the user defined requirements
# @param headers [Hash | JSONAPI::HeaderCollection] The collection of provided headers. Keys should be upper case strings
# with underscores instead of dashes.
# @param config (see #check_user_document_requirements)
def check_user_header_requirements(headers, config_manager, opts)
- return if config_manager.nil? || config_manager.default?
+ return if config_manager.nil?
+
config = get_config(config_manager, opts[:http_method], opts[:path])
+ return if config.default? && config_manager.size.positive?
err =
check_for_required_headers(headers, config.required_headers)
# To add more user requirement features, add more methods here
@@ -75,11 +77,13 @@
# Performs compliance checks on the query params to see if it complies
# to the user defined requirements
# @param rack_req_params [Hash] The hash of the query parameters given by Rack::Request
# @param config (see #check_user_document_requirements)
def check_user_query_param_requirements(rack_req_params, config_manager, opts)
- return if config_manager.nil? || config_manager.default?
+ return if config_manager.nil?
+
config = get_config(config_manager, opts[:http_method], opts[:path])
+ return if config.default? && config_manager.size.positive?
err =
check_for_required_params(rack_req_params, config.required_query_params)
# To add more user requirement features, add more methods here