proudmonkey / AutoWrapper

A simple, yet customizable global exception handler and Http response wrapper for ASP.NET Core APIs.
MIT License
679 stars 82 forks source link

Null Result when bodyText contains StatusCode #131

Open cuneytdogru opened 2 years ago

cuneytdogru commented 2 years ago

When wrapped content contains StatusCode as a property, AutoWrapper deserialize it into ApiResponse class and changes the real status code value.

For example, when return body looks like this;

{ "messageId": "XXXXXXX", "messageDateTime": "2022-05-09",
"text": "this is a test of the new texting system", "messageStatus": "message-delivered", "statusCode": "202", }

wrapper deserialze 202 as a httpResponse and final response look like this without any result;

{ "version": "1.0.0.0", "statusCode": 202, "message": "GET Request successful." }

What i see is; It should only deserialize from bodyText if bodyText contains Result property. Otherwise must create a new instance.

Maybe that is not the complete solution but fixes the problem and passes all tests.