Leomar de Souza
Leomar de Souza

Reputation: 757

String array in query parameters swagger

I'm working on a project where there is an endpoint that receives a list of strings in the parameter, as shown in the code below:

public class PaymentFilter
{
    public List<string> Status  {get; set; }
}

[HttpGet]
public IActionResult Get([FromQuery] PaymentFilter filter)
{
    ...
}

However, in the swagger interface the status list is not reflected, as shown in the image:

enter image description here

How do I enable entries for the status list?

Upvotes: 4

Views: 4839

Answers (1)

Xinran Shen
Xinran Shen

Reputation: 9993

Click Try it out button and click Add string item then you can add parameter

enter image description here

Upvotes: 7

Related Questions