Skip to content

[csharp] If you have a definition named "Client", generated code wont' compile #2943

@langdonx

Description

@langdonx
Description

If you have a class definition named Client, the generated code won't compile because of a conflict with the namespace. Client seems like it might be a very common model name (Api not so much, maybe Model, but probably not as common as Client).

Swagger-codegen version

master, cloned at the time of posting

Swagger declaration file content or url

N/A

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i http://localhost:50002/swagger/docs/v1 -l csharp -c swagger-codegen-csharp-config.json --import-mappings Object=System.Object -o ./

Steps to reproduce

Just have a definition named Client in your spec.

Related issues

Couldn't find any related issues.

Suggest a Fix

Change the generated namespace from Client to ApiRestClient (worked well for my in my template).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions