question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Respect LowercaseUrls

See original GitHub issue

I added the following in my ConfigureServices section.

      services.AddRouting(options =>
      {
        options.LowercaseUrls = true;
      });
      services.AddSwagger();
 app.UseSwaggerUi3WithApiExplorer(settings =>
      {
        settings.GeneratorSettings.DefaultPropertyNameHandling = PropertyNameHandling.Default;
        settings.GeneratorSettings.OperationProcessors.Add(new OperationSecurityScopeProcessor("Authorization"));
        settings.GeneratorSettings.OperationProcessors.Add(new OperationSecurityScopeProcessor("ServiceAccount"));

        settings.GeneratorSettings.DocumentProcessors.Add(
          new SecurityDefinitionAppender("Authorization", new SwaggerSecurityScheme
          {
            Type = SwaggerSecuritySchemeType.ApiKey,
            Name = "Authorization",
            Description = "The identity token responsible for request.",
            In = SwaggerSecurityApiKeyLocation.Header
          }));

        settings.GeneratorSettings.DocumentProcessors.Add(
          new SecurityDefinitionAppender("ServiceAccount", new SwaggerSecurityScheme
          {
            Type = SwaggerSecuritySchemeType.ApiKey,
            Name = "ServiceAccount",
            Description = "The service account token responsible for request.",
            In = SwaggerSecurityApiKeyLocation.Header
          }));
      });

The capitalization is not being respected in the SwaggerUI.

Similar to https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/74 on Swashbuckle Implementation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
pranavkmcommented, Jul 3, 2018

Filed https://github.com/aspnet/Mvc/issues/8006 to track addressing this in MVC.

2reactions
bangonkalicommented, Mar 27, 2019

Okay it turns out I was using

opt.EnableEndpointRouting = false;

If this is false then it will not work. My First use of OData required me to use this but a video from here shows it isn’t needed so I’ve removed it since and the correct casing is now followed.

I think this can now be closed if opt.EnableEndpointRouting = false; is a known side effect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

asp.net mvc - Should my URLs be lowercase?
No, that's not necessary. Windows operating systems are case insensitive, including their server OS's and framework applications. Linux/Unix ...
Read more >
URLs Case Sensitive - How to Redirect Uppercase to ... - Inflow
Are URLs case sensitive? Learn how to redirect uppercase URLs to lowercase using htaccess or httpd.conf to prevent 404 errors from occurring.
Read more >
Outlook bug: URL paths/queries forced lowercase in tooltip
URLs in e-mails are getting their paths and queries to be forced lower-case URL host names are not case sensitive.
Read more >
Respect the LowercaseUrls Routing Setting · Issue #74
LowercaseUrls `. I'd like to create an issue in the ASP.NET Core repo as I'd prefer to solve it at source rather than...
Read more >
Cloudflare rules do not respect uppercase or lowercase ...
I have a problem with the Cloudflare rules, since I try to cache the html of the static content but the rule affects...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found