mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-19 23:54:22 +01:00
fixed error in swagger documentation
* set pin request needs to be a POST request * added payload to swagger documentation
This commit is contained in:
@@ -2178,7 +2178,8 @@ func (a *Api) ListContacts(c *gin.Context) {
|
|||||||
// @Success 201
|
// @Success 201
|
||||||
// @Failure 400 {object} Error
|
// @Failure 400 {object} Error
|
||||||
// @Param number path string true "Registered Phone Number"
|
// @Param number path string true "Registered Phone Number"
|
||||||
// @Router /v1/accounts/{number}/pin [get]
|
// @Param data body SetPinRequest true "Request"
|
||||||
|
// @Router /v1/accounts/{number}/pin [post]
|
||||||
func (a *Api) SetPin(c *gin.Context) {
|
func (a *Api) SetPin(c *gin.Context) {
|
||||||
number, err := url.PathUnescape(c.Param("number"))
|
number, err := url.PathUnescape(c.Param("number"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/v1/accounts/{number}/pin": {
|
"/v1/accounts/{number}/pin": {
|
||||||
"get": {
|
"post": {
|
||||||
"description": "Sets a new Signal Pin",
|
"description": "Sets a new Signal Pin",
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -81,6 +81,15 @@ const docTemplate = `{
|
|||||||
"name": "number",
|
"name": "number",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Request",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/api.SetPinRequest"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2426,6 +2435,14 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"api.SetPinRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"pin": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"api.SetUsernameRequest": {
|
"api.SetUsernameRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/v1/accounts/{number}/pin": {
|
"/v1/accounts/{number}/pin": {
|
||||||
"get": {
|
"post": {
|
||||||
"description": "Sets a new Signal Pin",
|
"description": "Sets a new Signal Pin",
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
@@ -78,6 +78,15 @@
|
|||||||
"name": "number",
|
"name": "number",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Request",
|
||||||
|
"name": "data",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/api.SetPinRequest"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2423,6 +2432,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"api.SetPinRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"pin": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"api.SetUsernameRequest": {
|
"api.SetUsernameRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@@ -206,6 +206,11 @@ definitions:
|
|||||||
- styled
|
- styled
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
api.SetPinRequest:
|
||||||
|
properties:
|
||||||
|
pin:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
api.SetUsernameRequest:
|
api.SetUsernameRequest:
|
||||||
properties:
|
properties:
|
||||||
username:
|
username:
|
||||||
@@ -456,7 +461,7 @@ paths:
|
|||||||
summary: Remove Pin
|
summary: Remove Pin
|
||||||
tags:
|
tags:
|
||||||
- Accounts
|
- Accounts
|
||||||
get:
|
post:
|
||||||
description: Sets a new Signal Pin
|
description: Sets a new Signal Pin
|
||||||
parameters:
|
parameters:
|
||||||
- description: Registered Phone Number
|
- description: Registered Phone Number
|
||||||
@@ -464,6 +469,12 @@ paths:
|
|||||||
name: number
|
name: number
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
- description: Request
|
||||||
|
in: body
|
||||||
|
name: data
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/api.SetPinRequest'
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
|
|||||||
Reference in New Issue
Block a user