swagger-api / swagger-api/swagger-codegen-generators

[C#] Model template uses unsupported lambda helper

Open
#358 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Using swagger 3.0.7

The modelGeneric.mustache template file uses {{#lambda.camelcase_param}} helper that is not supported in handlebars.

From handlebars docs:
The optional Mustache-style lambdas are not supported. Instead Handlebars provides its own lambda resolution that follows the behaviors of helpers.

I verified that after I removed the lambda.camelcase_param the param appeared in the generated code, but of course with wrong format (CamelCase instead of correct camelCase).

The fix would require changing the template and adding a new helper to convert name to camelCase, because there is currently not such helper.

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 with the modelGeneric.mustache template and inspect the generator's existing helper implementations and Handlebars integration. Reproduce the generated C# model with the lambda removed, then add the supported camelCase handling and verify that the generated parameter uses the correct casing.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.