Fix: Minimal API JSON Options Not Applied

Published: May 29, 2026 · By Kumar Kunal

The Error

Response still camelCase:

{"firstName": "John"}

Quick Fix - 1 Min

1. builder.Services.ConfigureHttpJsonOptions(o => o.SerializerOptions.PropertyNamingPolicy = null). 2. Not Configure<JsonOptions> - that's for MVC. 3. Or app.MapGet("/", () => result).WithMetadata(new JsonOptionsAttribute())

Root Cause

Minimal APIs use HttpJsonOptions. MVC uses JsonOptions. Different services.

Found this helpful?

Master C# with our complete course. Real apps, real skills, job-ready in 2 hours.

Share this fix: Twitter LinkedIn

Comments on Fix: Minimal API JSON Options Not Applied (0)

No comments yet. Be the first to share your thoughts!