Skip to content

[REQ][csharp-netcore] httpclient library please remove old constructors #10001

@Havunen

Description

@Havunen

Is your feature request related to a problem? Please describe.

I would like to have a setting to not create old constructors when generating client for csharp-netcore httpclient library.
Currently I have large existing code base and we are migrating to .net core and same time converting our generated API clients to use http client based code. Because RestSharp in .net core may cause port exhaustion issue. Now when migrating the existing codebase it is difficult to find all the areas which need to be changed because the new generated code compiles the same as previous restsharp client did, however it would fail runtime to socket exhaustion issue.

Describe the solution you'd like

I would like to have an option or change http client library generator so that it does not generate constructors where its not required to give http client as parameter.

https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache#L192-L217

Describe alternatives you've considered

I have considered manually changing the generated code by commenting out these constructors but its problematic when we re-generate the code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions