OpenAPITools / OpenAPITools/openapi-generator

[BUG][csharp-netcore] -p modelPropertyNaming=original not considered everywhere

Open
#11,574 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

Example:

In general this option seems to work, but there are cases, where it does not: I have in a project a class with attributes "cid" and "_cid". This will result to errors in the instance creation (constructor) method:

   public CATIAPIAddressQueueMembership(string cid = default(string), .... , string cid = default(string),......)
    {
        this._cid = cid;
        ....
        this.cid = cid;
        ....

Another position is the documentation in front of this method ...

...
/// Framework Attribute. Maintains a unique ID - generated on the client side.
...
/// cid.
....

openapi-generator version

5.4.0

Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

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 reproducing the C# .NET Core generation described for openapi-generator 5.4.0 with modelPropertyNaming=original and attributes named "cid" and "_cid". Inspect the C# model generation templates and naming handling; done means the constructor parameters and XML documentation parameters remain distinct and the generated class compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.