Empty DTO list from swagger
For some reason whatever list of sizes I input, it always tells me in the debugger that the list of ProductCreateSizeRequests is empty.
,
16 Replies
it sees every image from the images list, but no sizes
What does ProductCreateSizeRequest look like?
public class ProductCreateSizeRequest
{
public string Name { get; set; }
public int Count { get; set; }
}
Does it work if your Json uses Name and Count instead of name and count ?
nope
Oh wait
You need square brackets for a List
yeah but shouldn't the swagger already consider it as an array?
it works for images " -F 'Images=@pexels-photo-991679 (1).jpeg;type=image/jpeg' \
-F 'Images=@pexels-photo-991679 (1).jpeg;type=image/jpeg' \
-F 'Images=@pexels-photo-991679 (1).jpeg;type=image/jpeg'"
it should work for dto's
"-F 'Sizes={
"Name": "da",
"Count": 0
}' \
-F 'Sizes={
"name": "string",
"count": 0
}' "
i tried like this
still nothing
You specified it twice?
the other one's empty
let me try
only once
dont think itll make a difference tho
yeah no differenc
i dont think thats the problem
i suppose i'll just make a different endpoint
to add the sizes
and not do it in the same one
if u find a solution
DM me please
š
anyone knows how to fix this?