Replies: 1 comment 1 reply
-
I'm not sure what "All attempts..." included, but OData has its own method for configuring casing. The default is Pascalcase, but most people expect Camelcase as the de facto for JSON, which is also the default for ASP.NET Core. API Versioning aligns to Camelcase by default as part of the 80/20 rule with the intent you have less to configure. Reverting to the default settings is as simple as: builder.Services.AddControllers().AddOData();
builder.Services.AddApiVersioning()
.AddOData(
options =>
{
// the default factory method includes .EnableLowerCamelCase()
options.ModelBuilder.ModelBuilderFactory = () => new ODataConventionModelBuilder();
options.AddRouteComponents();
}); The Versioned OData Model Builder topic provides additional documentation and the builder is exposed via |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Property names w/ OData API versioning are being serialized into camelCase when I would like them to be PascalCase. All attempts at overriding this have failed. Please advise on how to accomplish this with your library.
Beta Was this translation helpful? Give feedback.
All reactions