delphimvcframework icon indicating copy to clipboard operation
delphimvcframework copied to clipboard

Swagger Param Body Array

Open intracloud opened this issue 2 years ago • 3 comments
trafficstars

Hi,

How define in MVCSwagParam that body is jsonArray and not jsonBody. If I indicate that the body is of type ptArray, Swagger still shows the interface as a jsonObject and not as a jsonArray

[MVCSwagParam(TMVCSwagParamLocation.plBody,'xxx,'xxx',TClass, TMVCSwagParamType.ptArray)]

In MVCSwagResponses is possible add true in the fourth parameter.

Thanks for all.

intracloud avatar Nov 13 '23 15:11 intracloud

Maybe @joaoduarte19 can help you with this

danieleteti avatar Nov 28 '23 07:11 danieleteti

Hi,

How define in MVCSwagParam that body is jsonArray and not jsonBody. If I indicate that the body is of type ptArray, Swagger still shows the interface as a jsonObject and not as a jsonArray

[MVCSwagParam(TMVCSwagParamLocation.plBody,'xxx,'xxx',TClass, TMVCSwagParamType.ptArray)]

In MVCSwagResponses is possible add true in the fourth parameter.

Thanks for all.

Currently it is not possible to define the body type parameter as an array.

I'll add this function ASAP.

joaoduarte19 avatar Nov 28 '23 17:11 joaoduarte19

Thanks.

On Tue, Nov 28, 2023 at 6:14 PM João Antônio Duarte < @.***> wrote:

Hi,

How define in MVCSwagParam that body is jsonArray and not jsonBody. If I indicate that the body is of type ptArray, Swagger still shows the interface as a jsonObject and not as a jsonArray

[MVCSwagParam(TMVCSwagParamLocation.plBody,'xxx,'xxx',TClass, TMVCSwagParamType.ptArray)]

In MVCSwagResponses is possible add true in the fourth parameter.

Thanks for all.

Currently it is not possible to define the body type parameter as an array.

I'll add this function ASAP.

— Reply to this email directly, view it on GitHub https://github.com/danieleteti/delphimvcframework/issues/713#issuecomment-1830326052, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACERZMWAULBGFKXUS5C5ZALYGYLWXAVCNFSM6AAAAAA7JJY5ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZQGMZDMMBVGI . You are receiving this because you authored the thread.Message ID: @.***>

--

RAFA FERNÁNDEZCEO CTO Intracloud 655.52.98.79 @.*** http://www.intracloud.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada y/o confidencial. Si no es Vd. el destinatario indicado queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error le rogamos nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.

This message is intended exclusively for its address and may contain information that is CONFIDENTIAL and protected by professional privilege. If you are not the intended recipient you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited by law. If this message has been received in error, please immediately notify us via e-mail and delete it.

intracloud avatar Nov 28 '23 23:11 intracloud

Any news about this? 3.4.2-magnesium could receive this fix.

danieleteti avatar Mar 08 '24 15:03 danieleteti

Hi,

How define in MVCSwagParam that body is jsonArray and not jsonBody. If I indicate that the body is of type ptArray, Swagger still shows the interface as a jsonObject and not as a jsonArray

[MVCSwagParam(TMVCSwagParamLocation.plBody,'xxx,'xxx',TClass, TMVCSwagParamType.ptArray)]

In MVCSwagResponses is possible add true in the fourth parameter.

Thanks for all.

The Swagger generator has been modified to accept body parameters as an array of objects. It was done as suggested: [MVCSwagParam(TMVCSwagParamLocation.plBody,'xxx,'xxx',TClass, TMVCSwagParamType.ptArray)]

See this being used in samples/swaggerdoc

joaoduarte19 avatar Mar 09 '24 21:03 joaoduarte19

Thanks. Greet job.

intracloud avatar Mar 10 '24 17:03 intracloud