Skip to content

Commit

Permalink
Merge pull request #10 from ukchukx/master
Browse files Browse the repository at this point in the history
Construct params explicity
  • Loading branch information
heywhy authored Jan 4, 2024
2 parents 7bd7505 + b95b8d8 commit 7a2ab7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ defmodule Request.Validator do

@spec validate(Plug.Conn.t() | map()) :: Request.Validator.validation_result()
def validate(%Plug.Conn{} = conn) do
Request.Validator.validate(__MODULE__, conn.params, unquote(opts) ++ [conn: conn])
params = conn.query_params |> Map.merge(conn.body_params) |> Map.merge(conn.path_params)
Request.Validator.validate(__MODULE__, params, unquote(opts) ++ [conn: conn])
end

def validate(params) when is_map(params) do
Expand Down

0 comments on commit 7a2ab7c

Please sign in to comment.