-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operation GET generates both body param and path param #66
Comments
swagger-akka-http uses swagger-jaxrs under the hood. |
Hi It worked:-) |
Hello, I got the same issue because, apparently, when you create a method
Using the |
|
Hi
I am new to swagger and http-akka. When I annotate my GET method I get this,
"/questions/{id}" : {
"get" : {
"tags" : [ "questions" ],
"summary" : "Retrives a question",
"description" : "",
"operationId" : "GetQuestion",
"produces" : [ "application/json" ],
"parameters" : [ {
"in" : "body",
"name" : "body",
"required" : false,
"schema" : {
"type" : "string"
}
}, {
"name" : "id",
"in" : "path",
"description" : "The unique id of the question",
"required" : true,
"type" : "string",
"default" : "test"
} ],
"responses" : {
"200" : {
"description" : "Returns the info if found",
"schema" : {
"$ref" : "#/definitions/Question"
}
},
"404" : {
"description" : "Resource not found"
},
"500" : {
"description" : "Internal server error"
}
}
}
}
},
But I have not specified any body. Seems it just turns up automatically.
What do I do wrong, here is the anotation on the method.
@path("/{id}")
@ApiOperation(value = "Retrives a question", nickname = "GetQuestion", httpMethod = "GET", response = classOf[Question])
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "id", value = "The unique id of the question", defaultValue="test", required = true, dataType = "string", paramType = "path")
))
@ApiResponses(Array(
new ApiResponse(code = 200, message = "Returns the info if found", response = classOf[Question]),
new ApiResponse(code = 404, message = "Resource not found"),
new ApiResponse(code = 500, message = "Internal server error")
))
def getById(id: String): Future[Option[Question]] = Future {
questions.find(_.id == id)
}
The text was updated successfully, but these errors were encountered: