Skip to content

C#: Constructor is malformed if last property is readOnly: true #2795

@ggood

Description

@ggood

Swagger-codegen 2.1.6. With the OpenAPI spec in this Gist:

https://gist.github.com/ggood/099933cdf7aba3cab4867abd500d1b25

the generated c# constructor won't compile, due to a missing argument:

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

        }

This happens when the last property in a definition is readOnly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions