Swagger class property decoration

34 Views Asked by At

In .NET core project, we have class, for example:

public class MyClass
{
   public string Items {get;set;}
}

In swagger model definition we want that Items property has definition of type string array and not string, how to acomplish that?

1

There are 1 best solutions below

0
Negi Rox On

If you want to pass arrayof strings in a uri your controller should be something like below.

public async Task<IHttpActionResult> GetStringsValues([FromUri]List<string> s){
   return s;
}