Use literal JSON for constant anonymous responses

Proprietary

Opt-in default-encoder port of fresh parameterless JavaScriptSerializer.Serialize(new { ... }) responses containing only explicit ASCII property names and unescaped ASCII string, Boolean or integer literals. Fold the bounded response into a JSON string literal in property order. Leave runtime values, explicit serializer settings/resolvers and custom serializer types, other overloads, discarded comments, aliases/scoped imports, lambdas/queries, generics and snapshots for review. Remove only an unused simple serialization import. Adopts a constant response and removes serializer/anonymous-object allocations; custom ASP.NET HttpEncoder behavior and returned-string identity are not preserved. Separate from version upgrades.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_0.UseLiteralJsonForConstantAnonymousResponses
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_0.UseLiteralJsonForConstantAnonymousResponses

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.