Skip to content

C#: Constructor is malformed if first property is readOnly: true #2911

@dmilov

Description

@dmilov
Description

C# class constructor is not generated properly when first property is readonly.

Here is the produced code:

public Foo(, string Baz = null)
{
this.Baz = Baz;
}

Swagger-codegen version

Swagger-codegen built with latest code from master.

Swagger declaration file content or url

https://gist.github.com/dmilov/770cd90452d310fe870156e5ee3ba087

Command line used for generation

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i /tmp/foo.yaml -l csharp -o /var/tmp/foo_csharp

Related issues

#2795

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions