Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 346
Leomar de Souza Avatar asked Oct 25 '25 01:10

Leomar de Souza


1 Answers

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

enter image description here

like image 57
Xinran Shen Avatar answered Oct 26 '25 21:10

Xinran Shen