Skip to content

C# Code Generation generates method with return default(void) #3912

@mikoskinen

Description

@mikoskinen

The C# generator generated client method with the following signature:

public async System.Threading.Tasks.Task AttachmentsPatchAsync(int attachmentId, AttachmentRename body, System.Threading.CancellationToken cancellationToken)

Problem is that the method tries to return default(void) which doesn't compile:

                try
                {
                    var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                    if (response_.Content != null && response_.Content.Headers != null)
                    {
                        foreach (var item_ in response_.Content.Headers)
                            headers_[item_.Key] = item_.Value;
                    }

                    ProcessResponse(client_, response_);

                    var status_ = (int)response_.StatusCode;
                    return default(void);
                }

Instead of this I suppose plain return would work.

This is with OperationGenerationMode = OperationGenerationMode.MultipleClientsFromPathSegments.

The Open API spec is: https://dev.procountor.com/static/swagger.latest.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions