Hello,
I am new to Swagger and am using it to create the documentation for my API. I am manually writing a swagger.json file for my project and importing it to the editor at
editor.swagger.io to view the result as I work.
I have done some research, and I can see that in order to have multiple parameters in the body of a result, one must use a schema. My code is as follows:
"parameters": [
{
"name": "user",
"in": "body",
"description": "name, email, and password",
"required": true,
"schema": {
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"password": { "type": "string" }
}
}
}
]
This works fine to specify multiple body parameters, but of course the result is the following request:
POST /endpoint HTTP/1.1
Host: example.url.com
Content-Type: application/json
{
"name": "scott",
"email": "scottATmail.com",
"password": "my_pass"
}
Is there a way for me to specify Content-Type: application/x-www-form-urlencoded as follows:
POST /endpoint HTTP/1.1
Host: example.url.com
Content-Type: application/x-www-form-urlencoded
name=scott&email=scott%40mail.com&password=my_pass
Thank you for your time and please let me know if I can provide any more info.