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
in: formData in swagger:route annotation translates to nothing (in field is omitted) in the yaml spec file. It's specified in the Swagger 2.0 Specs that to specify a field is provided as application/x-www-form-urlencoded or multipart/form-data in a POST request, its in field value should be formData. Looking into the code, specifically here, looks like the valid values for the in field doesn't contain formData, but contains form which I believe has the same meaning.
My suggestion is to have this stated somewhere in the docs (my bad if it's already there, I tried to look for it but couldn't find it mentioned anywhere).
Thanks for this extremely helpful tool!
Steps to reproduce
Add swagger:route annotation with a param with in as formData
// swagger:route POST /v1/example/route operationName// Very important operation// consumes:// - application/x-www-form-urlencoded// parameters:// ......// ......// ......// +name: encryption_public_key// description: Public key of the referee client in case of private sharing. Used for proxy re-encryption.// in: formData// type: string// .......// .......// .......// responses:// ......// ......
Run swagger generate spec to generate the yaml file
Additionally, in: form doesn't pass swagger 2.0 validation, since only formData is allowed. This causes any generation of presentable format (like md) to fail.
Problem statement
in: formData
inswagger:route
annotation translates to nothing (in
field is omitted) in the yaml spec file. It's specified in the Swagger 2.0 Specs that to specify a field is provided asapplication/x-www-form-urlencoded
ormultipart/form-data
in a POST request, itsin
field value should beformData
. Looking into the code, specifically here, looks like the valid values for thein
field doesn't containformData
, but containsform
which I believe has the same meaning.My suggestion is to have this stated somewhere in the docs (my bad if it's already there, I tried to look for it but couldn't find it mentioned anywhere).
Thanks for this extremely helpful tool!
Steps to reproduce
swagger:route
annotation with a param within
asformData
swagger generate spec
to generate the yaml fileAs you can see, no
in
field at all.Environment
swagger version: v0.30.6-0.20240131062529-abb53530bfcf
go version: go1.22.1 darwin/arm64
OS: MacOS 13.2.1 (22D68) over M1 Pro Chip
The text was updated successfully, but these errors were encountered: