XiaoFaye / WooCommerce.NET

A .NET Wrapper for WooCommerce/WordPress REST API
MIT License
391 stars 217 forks source link

Wrong type for json parse #746

Open Krzywson opened 1 year ago

Krzywson commented 1 year ago

Woo - 6 Woo.Net - 0.8.6

Create an webhook in store which is called when somebody place order, set endpoint to your api Asp

obraz

You can copy paste data (body) to postman and call your endpoint for replicate

obraz obraz

Trying deserialize it with Newton and some other wild combinations with system.text.json settings

Mertsch commented 5 months ago

STJ, which is the new default for ASP.NET 6+ is much stricter when it comes to JSON handling. You need to enforce Newtonsoft de-serialization, since it's invalid to put a number (Int64) into a string.

E.g. Remove the [FromBody] and use Newtonsoft on Request.Content (Body) directly