How to add custom “Cannot deserialize” error message in ASP.NET Core 2
问题 I am building an asp.net-core REST api. How to change the default error: "Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Namespace.Name.Space.Type' because the type requires a JSON object (e.g. {\"name\":\"value\"}) to deserialize correctly. I don't want to expose namespaces or any implementation details with our clients. This error message is added to 400 - Bad Request response, when the client POST an object different from the required JSON. Could be configurable for