You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure why the application/x-www-form-urlencoded is part of generated of the specs. I believe it's more accurate to have only the type specified by @Accept in addition to format: binary for the definition:
Describe the bug
According to the OpenAPI 3 documentation https://swagger.io/docs/specification/v3_0/describing-request-body/file-upload/, it is possible to specify a binary file request body by specifying the type as
string
and the format asbinary
. For example:This is somehow different from swagger 2 format which needs the usage of
formData
for specifying binary dataNot only the annotation for specifying a binary data file did not change from version 1 to version 2 of swag:
but also the produced specs are confusing if I use
--v3.1
:I am not sure why the
application/x-www-form-urlencoded
is part of generated of the specs. I believe it's more accurate to have only the type specified by@Accept
in addition toformat: binary
for the definition:It would help if a new annotation is added for v2 that will help in producing definitions for binary types. For example:
To Reproduce
running
swag init --v3.1
on a folder that contains the following file:Expected behavior
Your swag version
v2.0.0
Your go version
1.22.4
The text was updated successfully, but these errors were encountered: