How to pass base url in the form http://localhost:3000/resources/api/?key=aslkdajd1323121lklakskdl
to swagger ui ?
I was able to access http://localhost:3000/resources/api
but when I add auth filter and pass key, it says, Unauthorized
.
Using swagger 1.X
Pre-populating the parameter through apiKeyauthorization in index.html did not help, but when I type in the key in UI, it worked. Unable to understand the reason for this. Hope someone can help me make sense out of it.
Try this swagger 2.0 file (use http://studio.restlet.com to downgrade to version 1.2) :
{
"swagger": "2.0",
"info": {
"version": "0.0.1",
"title": "Todo App"
},
"host": "localhost:3000",
"schemes": [
"http"
],
"paths": {
"/resources/api": {
"post": {
"parameters": [
{
"name": "key",
"in": "query",
"description": "key",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Successful response"
}
}
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With