From 47a9e5743ff2f4979c777eda5e2d883f25b9e1cb Mon Sep 17 00:00:00 2001 From: Charles John Date: Fri, 3 Mar 2023 09:09:55 +0530 Subject: [PATCH] Fix boolean validation --- lib/phoenix_swagger/conn_validator.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/phoenix_swagger/conn_validator.ex b/lib/phoenix_swagger/conn_validator.ex index 6939a2a..4529675 100644 --- a/lib/phoenix_swagger/conn_validator.ex +++ b/lib/phoenix_swagger/conn_validator.ex @@ -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 else.", "#/#{name}"} end defp validate_integer(name, value, parameters) do