Skip to content

Commit

Permalink
fixed swagger documentation for search endpoint
Browse files Browse the repository at this point in the history
see #622
  • Loading branch information
bbernhard committed Nov 29, 2024
1 parent b530fbb commit db97de3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ func (a *Api) SendStopTyping(c *gin.Context) {
// @Param numbers query []string true "Numbers to check" collectionFormat(multi)
// @Success 200 {object} []SearchResponse
// @Failure 400 {object} Error
// @Router /v1/search [get]
// @Router /v1/search/{number} [get]
func (a *Api) SearchForNumbers(c *gin.Context) {
query := c.Request.URL.Query()
if _, ok := query["numbers"]; !ok {
Expand Down
4 changes: 3 additions & 1 deletion src/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,7 @@ const docTemplate = `{
}
}
},
"/v1/search": {
"/v1/search/{number}": {
"get": {
"description": "Check if one or more phone numbers are registered with the Signal Service.",
"consumes": [
Expand Down Expand Up @@ -2715,6 +2715,8 @@ var SwaggerInfo = &swag.Spec{
Description: "This is the Signal Cli REST API documentation.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion src/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@
}
}
},
"/v1/search": {
"/v1/search/{number}": {
"get": {
"description": "Check if one or more phone numbers are registered with the Signal Service.",
"consumes": [
Expand Down
2 changes: 1 addition & 1 deletion src/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ paths:
summary: Verify a registered phone number.
tags:
- Devices
/v1/search:
/v1/search/{number}:
get:
consumes:
- application/json
Expand Down

0 comments on commit db97de3

Please sign in to comment.