swagger-api / swagger-api/swagger-codegen
C# (.Net Framework and .Net Core) client code missing string interpolation
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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