I have a complex object to be passed as query string in ASP.Net Core 3.2.
public class Customer
{
public string Firstname { get; set; }
public List<Address> Addresses { get; set; }
}
public class Address
{
public string Home_Address { get; set; }
public string Office_Address { get; set; }
}
It works in Postman as below:
http://localhost:52100/v1/Customer?Addresses[0].Home_Address=123HomeStreet&Addresses[0].Office_Address=123OfficeStreet
But, how to pass the value in Swagger documentation for Addresses which is of type "array[object] (query)" http://localhost:52100/v1/swagger-ui/index.html
I have Swashbuckle.AspNetCore 5.4.1, Swashbuckle.AspNetCore.Annotations 5.4.1, Swashbuckle.AspNetCore.Filters 5.1.1 references added in my project
[FromQuery]
attribute in your action? – FixativeOperationFilter
for this. – Fixative?Addresses%5B0%5D.Home_Address=123&Addresses%5B0%5D.Office_Address=123
– Fixative