swagger-api / swagger-api/swagger-codegen

C# (.Net Framework and .Net Core) client code missing string interpolation

Open
#8,302 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

The api.mustache has the following for .Net Framework:

       var localVarPath = $"{{#netStandard}}.{{/netStandard}}{{{path}}}";

and for .Net Core

var path = ...

which generates the following code:

      var localVarPath = "/api/admin/collection/{collectionId}";

Basically leaving a string interpolation unresolved.

Swagger-codegen version

Latest

Suggest a fix/enhancement

Just add the string interpolation $ in two place :

       var localVarPath = **$**"{{#netStandard}}.{{/netStandard}}{{{path}}}";

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

Open api.mustache and inspect the .NET Framework and .NET Core path-generation sections described in the issue. Ensure both generated localVarPath forms preserve string interpolation, then generate a C# client and confirm a path such as /api/admin/collection/{collectionId} is handled as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.