mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-19 15:44:28 +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
|
||||
// @Failure 400 {object} Error
|
||||
// @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) {
|
||||
number, err := url.PathUnescape(c.Param("number"))
|
||||
if err != nil {
|
||||
|
||||
@@ -65,7 +65,7 @@ const docTemplate = `{
|
||||
}
|
||||
},
|
||||
"/v1/accounts/{number}/pin": {
|
||||
"get": {
|
||||
"post": {
|
||||
"description": "Sets a new Signal Pin",
|
||||
"produces": [
|
||||
"application/json"
|
||||
@@ -81,6 +81,15 @@ const docTemplate = `{
|
||||
"name": "number",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Request",
|
||||
"name": "data",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.SetPinRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -2426,6 +2435,14 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.SetPinRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pin": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.SetUsernameRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
}
|
||||
},
|
||||
"/v1/accounts/{number}/pin": {
|
||||
"get": {
|
||||
"post": {
|
||||
"description": "Sets a new Signal Pin",
|
||||
"produces": [
|
||||
"application/json"
|
||||
@@ -78,6 +78,15 @@
|
||||
"name": "number",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Request",
|
||||
"name": "data",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.SetPinRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -2423,6 +2432,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.SetPinRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pin": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"api.SetUsernameRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@@ -206,6 +206,11 @@ definitions:
|
||||
- styled
|
||||
type: string
|
||||
type: object
|
||||
api.SetPinRequest:
|
||||
properties:
|
||||
pin:
|
||||
type: string
|
||||
type: object
|
||||
api.SetUsernameRequest:
|
||||
properties:
|
||||
username:
|
||||
@@ -456,7 +461,7 @@ paths:
|
||||
summary: Remove Pin
|
||||
tags:
|
||||
- Accounts
|
||||
get:
|
||||
post:
|
||||
description: Sets a new Signal Pin
|
||||
parameters:
|
||||
- description: Registered Phone Number
|
||||
@@ -464,6 +469,12 @@ paths:
|
||||
name: number
|
||||
required: true
|
||||
type: string
|
||||
- description: Request
|
||||
in: body
|
||||
name: data
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/api.SetPinRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
|
||||
Reference in New Issue
Block a user