Hi Zeyad,

I would say we should have a validation in the 
`SynchronousCommandProcessingService` class before executing the command to 
check whether the body is a valid JSON or not.

Alternatively we could enhance the processor logic to handle the empty body as 
an empty JSON ( {} )...

What do you think?

Regards,
Adam

> On 15 Mar 2024, at 14:47, Zeyad Nasef <[email protected]> wrote:
> 
> Hi there.
> I encountered an issue while attempting to resolve FINERACT-1269 and I'm 
> seeking assistance.
> 
> Issue Overview:
> The problem entails a JsonSyntaxException appearing in the logs, which 
> violates the logging guidelines outlined in the README.md, as it's an error 
> with the client request.
> 
> My Approach:
> I utilized the IntelliJ debugger to trace the code and sent a POST request to 
> the /v1/codes endpoint. I observed that the exception arises within the 
> JsonHelper class in fineract-core module, specifically within the parse() 
> method, when attempting to parse invalid JSON.
> 
> The Problem:
> This exception is thrown before reaching the line discussed by Michael 
> Vorburger.
> Map<String, Object> errorMap = gson.fromJson(ex.getMessage(), type); 
> Thus, idk if I misunderstood the issue. Any insights into the exact problem 
> and suggestions on how to address it would be greatly appreciated.
> Additionally, the project's build and run times are excessively long (~10 
> min) each time. That's Painful :")
> I would highly appreciate any recommendations to reduce the build and run 
> time.
> 
> Apologies for the lengthy message.
> Thank you!

Reply via email to