Skip to content

[C#] Return type InlineResponse200 and compilation error instead of object #1639

@artem-dudarev

Description

@artem-dudarev

If API return type is object then generated method returns InlineResponse200, but not object.
This InlineResponse200 also has an invalid Equals() implementation which produces the following compilation error:
error CS0126: An object of a type convertible to 'bool' is required

Swagger spec:

{
    "swagger": "2.0",
    "paths": {
        "/api/test": {
            "get": {
                "operationId": "Test",
                "responses": {
                    "200": {
                        "schema": { "type": "object" }
                    }
                }
            }
        }
    }
}

Generated code:

public interface IDefaultApi
{
    InlineResponse200 Test ();
}

public class InlineResponse200 : IEquatable<InlineResponse200>
{
    public bool Equals(InlineResponse200 other)
    {
        if (other == null)
            return false;
        return ;
    }
}

Expected:

public interface IDefaultApi
{
    object Test();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions