Unknown property used in expression: ${approved == \"true\"}

Hello, i have this error in my app spring boot : 2023-11-13 12:24:03.215 ERROR 22379 — [nio-8081-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path threw exception [Request processing failed; nested exception is org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : “{“type”:“RestException”,“message”:“Cannot complete task 7bbf851d-821f-11ee-bb7d-0242ac110004: Unknown property used in expression: ${approved == "true"}. Cause: Cannot resolve identifier ‘approved’”,“code”:0}”] with root cause

org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : “{“type”:“RestException”,“message”:“Cannot complete task 7bbf851d-821f-11ee-bb7d-0242ac110004: Unknown property used in expression: ${approved == "true"}. Cause: Cannot resolve identifier ‘approved’”,“code”:0}”
at org.springframework.web.client.HttpServerErrorException.create(HttpServerErrorException.java:100) ~[spring-web-5.3.15.jar:5.3.15]

Hello my friend!

If your variable is of boolean type, you must remove the quotation marks, and do the validation like this:

${approved == true}

because using the quotes, it is interpreting it as a String and not as a boolean.
I hope this helps!

William Robert Alves