Skip to content

Code generation enters infinite loop in v1.8.0 #77

@MichaelF1989

Description

@MichaelF1989

Describe the bug

When reading a schema MyClass with properties being named MyClass and MyClass1, the service enters an infinite loop and can only be cancelled by shutting down Visual Studio 2022 via the task manager.
I suspect that this seems to be a problem with the newest version 1.8.0 of this extension, as there weren't any issues for me a few weeks ago.

Steps to reproduce

Store the following json-file locally and try to generate the code from it (check "Generate CSharp Client" and then in the CSharp Client Settings uncheck GenerateClientClasses)

{
  "openapi": "3.0.1",
  "info": {
    "title": "My Web API",
    "version": "v2"
  },
  "paths": {
  },
  "components": {
    "schemas": {
      "MyClass": {
        "type": "object",
        "properties": {
          "MyClass": {
            "type": "string"
          },
          "MyClass1": {
            "type": "string"
          }
        }
      }
    }
  }
}

Expected result

Previously the property MyClass was renamed to MyClass2 in the generated code.

Actual result

Upon hitting finish, the service enters an infinite loop. The console output gets stuck as shown on the screenshot below.

Screenshots

console_output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions