swagger-api / swagger-api/swagger-codegen

ASP .Net Core 2 Route Error: The route template cannot start with a '/' or '~' character.

Open
#7,971 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

swagger dotnet core error Error: The route template cannot start with a '/' or '~' character .
dotnet core route format is not working.

[Route("//resource")]

Swagger-codegen version

0.4.4.0 (8eba539)

Command line used for generation

Code generated using Swagger editor 0.4.4.0 (8eba539)

Steps to reproduce

Just generate the dotnet core server of any API.

Suggest a fix/enhanceme

After find/replace all the [Route("//resource")] by [Route("resource")] it is working just fine.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by generating an ASP.NET Core server from any API, then search the generated output and code-generation templates for [Route("//resource")]. Confirm that the route template is emitted with a single leading slash, and verify the generated server no longer reports the ASP.NET Core route error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.