devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click!
https://waha.devlike.pro/
Apache License 2.0
819 stars 249 forks source link

[BUG][NOWEB] - Undocumented return of GET /api/sendText #406

Closed AliSot2000 closed 4 days ago

AliSot2000 commented 5 days ago

Describe the bug The Return Type of the GET /api/sendText Endpoint is only annotated as object. Running a simple request, shows the following:

{
  "key": {
    "remoteJid": "11111111111@s.whatsapp.net",
    "fromMe": true,
    "id": "3EB01401A448E0CB652738"
  },
  "message": {
    "extendedTextMessage": {
      "text": "Some Nice Message"
    }
  },
  "messageTimestamp": "1719917790",
  "status": "PENDING"
}

Version

{
  "version": "2024.6.8",
  "engine": "NOWEB",
  "tier": "PLUS",
  "browser": "/usr/bin/chromium"
}

To Reproduce Steps to reproduce the behavior:

  1. Start a Docker Container
  2. Go to http://localhost:3000/#/chatting/ChattingController_sendTextGet
  3. Click on Schema in Responses
  4. Observe, the body is only described as object

Expected behavior There's a proper Model in this location that describes the data returned

devlikepro commented 4 days ago

We'll mark GET /sendText as deprecated, thank you for details!

patron:PRO

AliSot2000 commented 4 days ago

Please mark the endpoint as deprecated then.

Dito to here

Change the paths./api/sendText.get in the openapi.json to the this:

{
                "operationId": "ChattingController_sendTextGet",
                "parameters": [
                    {
                        "in": "query",
                        "name": "phone",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "text",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "in": "query",
                        "name": "session",
                        "required": true,
                        "schema": {
                            "default": "default",
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        },
                        "description": ""
                    }
                },
                "security": [
                    {
                        "api_key": []
                    }
                ],
                "summary": "Send a text message",
                "deprecated": true,
                "tags": [
                    "chatting"
                ]
            }