Skip to content

Wrong QueryParameters property is generated from AnyOf with array #7210

@gpetrou

Description

@gpetrou

What are you generating using Kiota, clients or plugins?

API Client/SDK

In what context or format are you using Kiota?

Nuget tool

Client library/SDK language

Csharp

Describe the bug

When using anyOf with an array the wrong QueryParameters property is generated.

Expected behavior

Generate the correct QueryParameters property.

How to reproduce

Use the following specification:

{
    "name": "ids",
    "in": "query",
    "required": false,
    "schema": {
        "anyOf": [
            {
                "type": "array",
                "items": {
                    "type": "string"
                }
            },
            {
                "type": "null"
            }
        ],
        "max_items": 10,
        "default": [],
        "title": "ids"
    }
}

It will create:

[QueryParameter("ids")]
public string? ids { get; set; }

Shouldn't this create an array instead?

Open API description file

No response

Kiota Version

1.29.0

Latest Kiota version known to work for scenario above?(Not required)

No response

Known Workarounds

No response

Configuration

No response

Debug output

Click to expand log ```
</details>


### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    CsharpPull requests that update .net codestatus:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions