OpenAPITools / OpenAPITools/openapi-generator

[BUG][C#] Breaking changes introduced with v5.2.1

Open
#11,071 1 comment 2 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

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Properties like Version are generated with an starting underscore.
Version -> _Version
This is a breaking change without fallback.

openapi-generator version

I used 5.3.0, but the problem is already in 5.2.1

OpenAPI declaration file content or url

https://codebeamer.com/cb/api-docs/v3.json

Happens for example for this component:

      "ArtifactRevision": {
        "type": "object",
        "properties": {
          "id": {
            "minimum": 0,
            "type": "integer",
            "description": "Id of the entity",
            "format": "int32"
          },
          "version": {
            "type": "integer",
            "description": "Version of the artifact",
            "format": "int32"
          },
Generation Details

Create client side C# code with version 5.2.1 or later, no special setting used

Steps to reproduce
Related issues/PRs

Bug / breaking change introduced with following PR
https://github.com/OpenAPITools/openapi-generator/pull/10074

Suggest a fix

Possible fixes:

  • revert the change
  • fix like in the inline comment (use fully qualified names)
  • make list of reserved word configurable

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 reviewing PR #10074 and generating the C# client from the linked Codebeamer OpenAPI declaration, focusing on the ArtifactRevision component and its Version property. Compare output from before and after version 5.2.1, then determine which proposed behavior—reverting the change, using fully qualified names, or configurable reserved words—restores compatibility without renaming Version to _Version.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.