title: Change the JSON deserialization/serialization policy for single ASP.NET Core controller
body: <p>I have a controller that I use for a third party API, which uses a snake case naming convention. The rest of my controllers are used for my own app, which uses a camelcase JSON convention. I'd like to automatically deserialize and serialize my models from/to snake case for the API in that one controller. <a href="https://stackoverflow.com/questions/58570189/is-there-a-built-in-way-of-using-snake-case-as-the-naming-policy-for-json-in-asp">This question</a> explains how to use a snake case naming policy for JSON in the entire app, but is there a way that I can specify to use the naming policy only for that single controller?</p>
  <p>I've seen <a href="https://stackoverflow.com/questions/52605946/change-the-json-serialization-settings-of-a-single-asp-net-core-controller">Change the JSON serialization settings of a single ASP.NET Core controller</a> which suggests using an ActionFilter, but that only helps for ensuring that outgoing JSON is serialized properly. How can I get the incoming JSON deserialized to my models properly as well? I know that I can use <code>[JsonPropertyName]</code> on the model property names but I'd prefer to be able to set something at the controller level, not at the model level.</p>