From 2a3cc8c73330095b904badab5f67b3d9b3234576 Mon Sep 17 00:00:00 2001 From: Maysam Torabi Date: Tue, 8 Oct 2024 13:20:53 +0200 Subject: [PATCH] Fix boolean validation #284 --- 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..867a8a7 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 wrong.", "#/#{name}"} end defp validate_integer(name, value, parameters) do