3

I added OData to my .NET Web API. I only use it for querying data (HttpMethod GET).

When I run my application, and I look at Swagger I see the following:

enter image description here

As you can see, the OData endpoints use uppercase name for the resource set which I something I really dislike. It's important to note that the endpoints work fine even in lowercase.

How can I make it so that the OData endpoints use lowercase by default to create consistency in my swagger documentation?

Thanks in advance

1 Answer 1

5

Use:

services.AddRouting(options => options.LowercaseUrls = true);

In your startup.cs

1
  • 1
    Wow, I can't believe it was that easy. Thanks a lot.
    – Nathan
    Aug 31, 2021 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.