0

I have controller action like this;

 [HttpGet("[action]")]
    public async Task<ActionResult<ResultModel>> ToUnique(List<Model> models)

I want to send json data at swagger, swagger response to me this error that above. Json ınclude list.

firstly I tried [FromQuery] at param like this;

[HttpGet("[action]")]
        public async Task<ActionResult<ResultModel>> ToUnique([FromQuery]List<Model> models)

When this case I had to send every object as seperate in swagger request. Like this image; enter image description here

also when I debug it realize action params couldnt convert so param List was empty.

How I can solve this problem I want use this action just with swagger or postman there is no request from other sides to this 'toUnique' action.

After that I tried [FromBody] attribute like fromquery and error happened again as expected.

How I can solve this problem?

EsprnzJK
  • 25
  • 5
  • I solved this problem with [HttpPost] attribute instead [HttpGet] but I want to solution with [HttpGet] method. – EsprnzJK May 29 '23 at 13:31

0 Answers0