-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How do you add parameters to formData payload ? #16
Comments
Can you give a bit more info? What do your swagger-blocks definitions look like and how are they not working? |
here is an example swagger_path '/sessions' do
operation :post do
key :description, 'Login To Vestorly Platform'
key :operationId, 'login'
key :consumes, [
"application/x-www-form-urlencoded"
]
key :tags, [
'session'
]
parameter do
key :name, :username
key :in, :formData
key :description, 'Username in the XXXX platform'
key :required, true
key :type, :string
end
parameter do
key :name, :password
key :in, :formData
key :description, 'Password in XXXX Platform'
key :required, true
key :type, :string
end
response 200 do
key :description, 'Response'
schema do
key :'$ref', :Session
end
end
end
end Here is the call that works in CURL:
I cannot get swagger-blocks to send those username + password parameters in the post. Have tried every type of in parameter (header,path,query,formData, etc) |
also according to swaggers 2.0 spec, you can use the https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md |
That looks correct to me, except I don't understand what you mean by "get swagger-blocks to send those username + password parameters in the post"—Swagger::Blocks doesn't send anything, it's simply a way to define JSON in the Swagger style, for example as input to Swagger UI for generating API docs—it has nothing to do with actually how your server handles data. If the output of your |
Sorry - I see why that is confusing. I meant when I generate swagger.json As an example, go here: http://developers.vestorly.com/v2/#!/session/# and add a random username/password. 'username' not found is the response because it is not being sent in the request On Wed, Apr 15, 2015 at 4:13 PM, Mike Fotinakis notifications@github.com
|
Can you check that the swagger.json looks correct according to the spec and maybe manually fiddle with it until it works with Swagger UI the way you expect? Unfortunately this sounds like you're just missing some part of the configuration between Swagger JSON and Swagger UI, but not actually a problem with how swagger-blocks generates JSON. |
the issue was with sorry for wasting your time :) |
Not a waste, glad you found it. 👍 |
I have a post call, I am trying to add parameters to
formdata
with no successThe text was updated successfully, but these errors were encountered: