Skip to content

Commit

Permalink
Fix boolean validation xerions#284
Browse files Browse the repository at this point in the history
  • Loading branch information
maysam authored Oct 8, 2024
1 parent e64f856 commit 2a3cc8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/phoenix_swagger/conn_validator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ defmodule PhoenixSwagger.ConnValidator do
end
end

defp validate_boolean(_name, value, parameters) when value in ["true", "false"] do
defp validate_boolean(_name, value, parameters) when value in [true, false, "true", "false"] do
validate_query_params(parameters)
end

defp validate_boolean(name, _value, _parameters) do
{:error, "Type mismatch. Expected Boolean but got String.", "#/#{name}"}
{:error, "Type mismatch. Expected Boolean but got Something wrong.", "#/#{name}"}
end

defp validate_integer(name, value, parameters) do
Expand Down

0 comments on commit 2a3cc8c

Please sign in to comment.