How I can use object type when file media type exists? #580
Hosseinasadian
started this conversation in
General
Replies: 1 comment
-
Same question with version 8.4 new OAT\MediaType(
mediaType: 'multipart/form-data',
...
new OAT\Property(
property: 'products[]',
type: 'array',
items: new OAT\Items(properties: [
new OAT\Property(
...
),
new OAT\Property(
...
),
new OAT\Property(
...
),
], type: 'object') So I got this array only with 1 element, and it need to parse "products" => array:1 [
0 => """
{
...
}, {
...
}
"""
] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
composer show | grep l5-swagger
)php -v
): 7.4Description:
I use @OA\MediaType(mediaType="multipart/form-data") to upload file but in this state i can't use object type. When i get data by $request->all() objects returned as json and i must decode them. When I do this with other tools like postman it's work correctly.
My comment is below:
and the request all result is as following:
{
"data": "{\r\n "646a13353cda5de8310be64b": "kjskjds",\r\n "646b146479176e07a308fec2": [\r\n "مشکل در نحوه اتصال"\r\n ],\r\n "646b3c5c79176e07a308fecb": 0\r\n}",
"location": "{\r\n "lat": "45.3265478",\r\n "lng": "46.3214587"\r\n}",
"noncompliance": "{\r\n "646b3c5c79176e07a308fecb": "مشکل در نحوه اتصال"\r\n}",
"file": {}
}
Steps To Reproduce:
Beta Was this translation helpful? Give feedback.
All reactions